提交 81b74ac6 编写于 作者: J Jens Axboe

paride/pcd: cleanup queues when detection fails

The driver allocates queues for all the units it potentially
supports. But if we fail to detect any drives, then we fail
loading the module without cleaning up those queues. This is
now evident with the switch to blk-mq, though the bug has
been there forever as far as I can tell.

Also fix cleanup through regular module exit.
Reported-by: NRandy Dunlap <rdunlap@infradead.org>
Tested-by: NRandy Dunlap <rdunlap@infradead.org>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 6ce59025
...@@ -749,8 +749,12 @@ static int pcd_detect(void) ...@@ -749,8 +749,12 @@ static int pcd_detect(void)
return 0; return 0;
printk("%s: No CD-ROM drive found\n", name); printk("%s: No CD-ROM drive found\n", name);
for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) {
blk_cleanup_queue(cd->disk->queue);
cd->disk->queue = NULL;
blk_mq_free_tag_set(&cd->tag_set);
put_disk(cd->disk); put_disk(cd->disk);
}
pi_unregister_driver(par_drv); pi_unregister_driver(par_drv);
return -1; return -1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册