Skip to content
Commit 3f9a5aab authored by Vivek Goyal's avatar Vivek Goyal Committed by Jens Axboe
Browse files

floppy: Cleanup disk->queue before caling put_disk() if add_disk() was never called



add_disk() takes gendisk reference on request queue. If driver failed during
initialization and never called add_disk() then that extra reference is not
taken. That reference is put in put_disk(). floppy driver allocates the
disk, allocates queue, sets disk->queue and then relizes that floppy
controller is not present. It tries to tear down everything and tries to
put a reference down in put_disk() which was never taken.

In such error cases cleanup disk->queue before calling put_disk() so that
we never try to put down a reference which was never taken in first place.

Reported-and-tested-by: default avatarSuresh Jayaraman <sjayaraman@suse.com>
Tested-by: default avatarDirk Gouders <gouders@et.bocholt.fh-gelsenkirchen.de>
Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent cdccaa94
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment