diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 3a89f8daee0f127d10b7d612e13bba6a6bd3bb50..238957ff8d499b27c83bc1131a3d5ca9bd7dc647 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -533,6 +533,14 @@ void nvme_mpath_remove_disk(struct nvme_ns_head *head) kblockd_schedule_work(&head->requeue_work); flush_work(&head->requeue_work); blk_cleanup_queue(head->disk->queue); + if (!test_bit(NVME_NSHEAD_DISK_LIVE, &head->flags)) { + /* + * if device_add_disk wasn't called, prevent + * disk release to put a bogus reference on the + * request queue + */ + head->disk->queue = NULL; + } put_disk(head->disk); }