Staging: zram: free device memory when init fails
authorShahar Havivi <[email protected]>
Sat, 28 Aug 2010 07:09:05 +0000 (10:09 +0300)
committerGreg Kroah-Hartman <[email protected]>
Sat, 4 Sep 2010 00:37:15 +0000 (17:37 -0700)
Signed-off-by: Shahar Havivi <[email protected]>
Cc: Nitin Gupta <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/staging/zram/zram_drv.c

index 77d4d715a78936b01795667215875adf17781fc2..722c840ac6387456b5825feaf8375195c8bce5ac 100644 (file)
@@ -769,6 +769,7 @@ static int __init zram_init(void)
 free_devices:
        while (dev_id)
                destroy_device(&devices[--dev_id]);
+       kfree(devices);
 unregister:
        unregister_blkdev(zram_major, "zram");
 out: