diff options
author | Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com> | 2012-08-27 20:56:52 -0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-11-16 16:46:59 +0000 |
commit | ae1ab6ee65fe4cf7d6752b5aefffd97fc84984b2 (patch) | |
tree | cb1d149f4e1aec7a16184b1858b6d29fa4dbf779 /drivers | |
parent | aba58442cc2198273c9815253030e83ba6f42edc (diff) |
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 <ben@decadent.org.uk>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/floppy.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 38c062c1a1af..a6c3d180ba65 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4163,6 +4163,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; } |