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: next-20120910~57^2~1^2^2~5 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6a15303c7b97f52e21ac51351a62d76e0ab06fdc;p=karo-tx-linux.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 --- diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index c8d9e68a732e..1e09e998904f 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4151,6 +4151,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; }