without this patch, gdrom_major will leak when gd.cd_info alloc faild
Signed-off-by: Libo Chen <[email protected]>
---
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
On Fri, May 17, 2013 at 02:19:12PM +0800, Libo Chen wrote:
>
> without this patch, gdrom_major will leak when gd.cd_info alloc faild
>
> Signed-off-by: Libo Chen <[email protected]>
Acked-by: Tejun Heo <[email protected]>
This should be routed through the block tree. Can you please repost
with Jens Axboe <[email protected]> added?
Thanks.
--
tejun
"repost with Jens Axboe <[email protected]> added" suggest by Tejun Heo <[email protected]>
without this patch, gdrom_major will leak when gd.cd_info alloc faild
Signed-off-by: Libo Chen <[email protected]>
---
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