aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/null_blk.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
index a2e69d26266d..83a598ebb65a 100644
--- a/drivers/block/null_blk.c
+++ b/drivers/block/null_blk.c
@@ -425,10 +425,7 @@ static void null_del_dev(struct nullb *nullb)
425 list_del_init(&nullb->list); 425 list_del_init(&nullb->list);
426 426
427 del_gendisk(nullb->disk); 427 del_gendisk(nullb->disk);
428 if (queue_mode == NULL_Q_MQ) 428 blk_cleanup_queue(nullb->q);
429 blk_mq_free_queue(nullb->q);
430 else
431 blk_cleanup_queue(nullb->q);
432 put_disk(nullb->disk); 429 put_disk(nullb->disk);
433 kfree(nullb); 430 kfree(nullb);
434} 431}
@@ -578,10 +575,7 @@ static int null_add_dev(void)
578 disk = nullb->disk = alloc_disk_node(1, home_node); 575 disk = nullb->disk = alloc_disk_node(1, home_node);
579 if (!disk) { 576 if (!disk) {
580queue_fail: 577queue_fail:
581 if (queue_mode == NULL_Q_MQ) 578 blk_cleanup_queue(nullb->q);
582 blk_mq_free_queue(nullb->q);
583 else
584 blk_cleanup_queue(nullb->q);
585 cleanup_queues(nullb); 579 cleanup_queues(nullb);
586err: 580err:
587 kfree(nullb); 581 kfree(nullb);