[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <51997DA2.4000302@huawei.com>
Date: Mon, 20 May 2013 09:34:26 +0800
From: Libo Chen <clbchenlibo.chen@...wei.com>
To: <gregkh@...uxfoundation.org>, <axboe@...nel.dk>
CC: <tj@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Li Zefan <lizefan@...wei.com>
Subject: [PATCH] cdrom: gdrom: fix device number leak
"repost with Jens Axboe <axboe@...nel.dk> added" suggest by Tejun Heo <tj@...nel.org>
without this patch, gdrom_major will leak when gd.cd_info alloc faild
Signed-off-by: Libo Chen <libo.chen@...wei.com>
---
drivers/cdrom/gdrom.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index 4afcb65..5980cb9 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -830,9 +830,9 @@ probe_fail_cdrom_register:
del_gendisk(gd.disk);
probe_fail_no_disk:
kfree(gd.cd_info);
+probe_fail_no_mem:
unregister_blkdev(gdrom_major, GDROM_DEV_NAME);
gdrom_major = 0;
-probe_fail_no_mem:
pr_warning("Probe failed - error is 0x%X\n", err);
return err;
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists