Skip to contentSkip to conversation

nvme: fix a potential invalid pointer dereference

PATCH Applied Maurizio Lombardi 3 participants 3 messages Jan 31, 2023 – Feb 1, 2023 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: fix a potential invalid pointer dereference

In nvme_alloc_io_tag_set(), the connect_q pointer should be set to NULL in case of error to avoid potential invalid pointer dereferences.

---
 drivers/nvme/host/core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/host/core.c +1 -0
index 505e16f20e57..aba432c58fed 100644
@@ -4983,6 +4983,7 @@ int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
 
 out_free_tag_set:
 	blk_mq_free_tag_set(set);
+	ctrl->connect_q = NULL;
 	return ret;
 }
 EXPORT_SYMBOL_GPL(nvme_alloc_io_tag_set);
Signature · 1 line
2.31.1