From: Herton Ronaldo Krzesinski Date: Mon, 27 Aug 2012 23:56:52 +0000 (-0300) Subject: floppy: do put_disk on current dr if blk_init_queue fails X-Git-Tag: v3.7-rc4~23^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=238ab78469c6ab7845b43d5061cd3c92331b2452;p=profile%2Fivi%2Fkernel-x86-ivi.git floppy: do put_disk on current dr if blk_init_queue fails If blk_init_queue fails, we do not call put_disk on the current dr (dr is decremented first in the error handling loop). Cc: stable@vger.kernel.org Reviewed-by: Ben Hutchings Signed-off-by: Herton Ronaldo Krzesinski Signed-off-by: Jiri Kosina Signed-off-by: Jens Axboe --- diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 83112f0..9a558b6 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4150,6 +4150,7 @@ static int __init do_floppy_init(void) disks[dr]->queue = blk_init_queue(do_fd_request, &floppy_lock); if (!disks[dr]->queue) { + put_disk(disks[dr]); err = -ENOMEM; goto out_put_disk; }