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.0.51~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2000afe4fb86c374650371f41eb287746790d9ff;p=karo-tx-linux.git floppy: do put_disk on current dr if blk_init_queue fails commit 238ab78469c6ab7845b43d5061cd3c92331b2452 upstream. If blk_init_queue fails, we do not call put_disk on the current dr (dr is decremented first in the error handling loop). Reviewed-by: Ben Hutchings Signed-off-by: Herton Ronaldo Krzesinski Signed-off-by: Jiri Kosina Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 9955a53733b2..e07e3eded782 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4198,6 +4198,7 @@ static int __init 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; }