[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <5195CBE0.6010106@huawei.com>
Date: Fri, 17 May 2013 14:19:12 +0800
From: Libo Chen <clbchenlibo.chen@...wei.com>
To: <gregkh@...uxfoundation.org>
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
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