The patch titled Subject: zram: set default dev_id value to zero in zram_init() has been added to the -mm tree. Its filename is zram-rework-reset-and-destroy-path-fix-2.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/zram-rework-reset-and-destroy-path-fix-2.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/zram-rework-reset-and-destroy-path-fix-2.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx> Subject: zram: set default dev_id value to zero in zram_init() Set dev_id to zero and fix zram_devices allocation error handling path, can pass uninit dev_id to destroy_devices(). cosmetic: change destroy_devices() message from pr_debug() to pr_info(), as proposed by Minchan Kim. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx> Cc: Ganesh Mahendran <opensource.ganesh@xxxxxxxxx> Cc: Jerome Marchand <jmarchan@xxxxxxxxxx> Cc: Minchan Kim <minchan@xxxxxxxxxx> Cc: Nitin Gupta <ngupta@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/block/zram/zram_drv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff -puN drivers/block/zram/zram_drv.c~zram-rework-reset-and-destroy-path-fix-2 drivers/block/zram/zram_drv.c --- a/drivers/block/zram/zram_drv.c~zram-rework-reset-and-destroy-path-fix-2 +++ a/drivers/block/zram/zram_drv.c @@ -1136,12 +1136,12 @@ static void destroy_devices(unsigned int kfree(zram_devices); unregister_blkdev(zram_major, "zram"); - pr_debug("Destroyed %u device(s)\n", nr); + pr_info("Destroyed %u device(s)\n", nr); } static int __init zram_init(void) { - int ret, dev_id; + int ret = -ENOMEM, dev_id = 0; if (num_devices > max_num_devices) { pr_warn("Invalid value for num_devices: %u\n", @@ -1157,10 +1157,8 @@ static int __init zram_init(void) /* Allocate the device array and initialize each one */ zram_devices = kzalloc(num_devices * sizeof(struct zram), GFP_KERNEL); - if (!zram_devices) { - ret = -ENOMEM; + if (!zram_devices) goto out_error; - } for (dev_id = 0; dev_id < num_devices; dev_id++) { ret = create_device(&zram_devices[dev_id], dev_id); _ Patches currently in -mm which might be from sergey.senozhatsky@xxxxxxxxx are zram-clean-up-zram_meta_alloc.patch zram-free-meta-table-in-zram_meta_free.patch zram-fix-umount-reset_store-mount-race-condition.patch zram-rework-reset-and-destroy-path.patch zram-rework-reset-and-destroy-path-fix.patch zram-rework-reset-and-destroy-path-fix-2.patch zram-rework-reset-and-destroy-path-fix-2-fix.patch zram-check-bd_openers-instead-bd_holders.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html