diff mbox series

[4/5] blk-mq: Set hctx pointer to NULL in blk_mq_exit_hw_queues()

Message ID 20190423122951.134531-5-hare@suse.de (mailing list archive)
State New, archived
Headers show
Series blk-mq: fixes for Ming Leis V6 patchset | expand

Commit Message

Hannes Reinecke April 23, 2019, 12:29 p.m. UTC
When clearing the hardware context we should be setting the pointer
to NULL, too, to avoid accesses to invalid hctx entries.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 block/blk-mq.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 3da453b11deb..f620462dc4d1 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2275,6 +2275,7 @@  static void blk_mq_exit_hw_queues(struct request_queue *q,
 	queue_for_each_hw_ctx(q, hctx, i) {
 		blk_mq_debugfs_unregister_hctx(hctx);
 		blk_mq_exit_hctx(q, set, hctx, i);
+		q->queue_hw_ctx[i] = NULL;
 	}
 }