pktcdvd: Fix pkt_setup_dev() error path
authorBart Van Assche <bart.vanassche@wdc.com>
Tue, 2 Jan 2018 19:39:47 +0000 (11:39 -0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 5 Jan 2018 16:03:03 +0000 (09:03 -0700)
commit5a0ec388ef0f6e33841aeb810d7fa23f049ec4cd
treec5cab6b9052cd1655076a568728575e9a112c0d1
parent8b7bc849889d36572af5c6e3c3b2ad4b19a81be7
pktcdvd: Fix pkt_setup_dev() error path

Commit 523e1d399ce0 ("block: make gendisk hold a reference to its queue")
modified add_disk() and disk_release() but did not update any of the
error paths that trigger a put_disk() call after disk->queue has been
assigned. That introduced the following behavior in the pktcdvd driver
if pkt_new_dev() fails:

Kernel BUG at 00000000e98fd882 [verbose debug info unavailable]

Since disk_release() calls blk_put_queue() anyway if disk->queue != NULL,
fix this by removing the blk_cleanup_queue() call from the pkt_setup_dev()
error path.

Fixes: commit 523e1d399ce0 ("block: make gendisk hold a reference to its queue")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Cc: <stable@vger.kernel.org> # v3.2
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/pktcdvd.c