lkml.org 
[lkml]   [2021]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 01/12] floppy: fix add_disk() assumption on exit
Date
Even if the queue was cleaned up on exit,
putting the disk *is* still required, and
likewise, blk_cleanup_queue() on a null queue
should be a no-op now, after the patch titled
"block: skip queue if NULL on blk_cleanup_queue()"
so it is safe to use even if the queue is NULL.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/block/floppy.c | 13 -------------
1 file changed, 13 deletions(-)

diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 87460e0e5c72..b68f4b6bf737 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4953,19 +4953,6 @@ static void __exit floppy_module_exit(void)
blk_cleanup_queue(disks[drive][i]->queue);
}
blk_mq_free_tag_set(&tag_sets[drive]);
-
- /*
- * These disks have not called add_disk(). Don't put down
- * queue reference in put_disk().
- */
- if (!(allowed_drive_mask & (1 << drive)) ||
- fdc_state[FDC(drive)].version == FDC_NONE) {
- for (i = 0; i < ARRAY_SIZE(floppy_type); i++) {
- if (disks[drive][i])
- disks[drive][i]->queue = NULL;
- }
- }
-
for (i = 0; i < ARRAY_SIZE(floppy_type); i++) {
if (disks[drive][i])
put_disk(disks[drive][i]);
--
2.27.0
\
 
 \ /
  Last update: 2021-07-15 23:00    [W:0.065 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site