Staging: zram: free device memory when init fails
Signed-off-by: Shahar Havivi <shaharh@redhat.com> Cc: Nitin Gupta <ngupta@vflare.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
9e693e4375
commit
273ad8dcef
|
@ -769,6 +769,7 @@ static int __init zram_init(void)
|
||||||
free_devices:
|
free_devices:
|
||||||
while (dev_id)
|
while (dev_id)
|
||||||
destroy_device(&devices[--dev_id]);
|
destroy_device(&devices[--dev_id]);
|
||||||
|
kfree(devices);
|
||||||
unregister:
|
unregister:
|
||||||
unregister_blkdev(zram_major, "zram");
|
unregister_blkdev(zram_major, "zram");
|
||||||
out:
|
out:
|
||||||
|
|
Loading…
Reference in New Issue