nvme: fix a potential invalid pointer dereference
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.
Signed-off-by Maurizio Lombardi <[email protected]>
--- drivers/nvme/host/core.c | 1 + 1 file changed, 1 insertion(+)
drivers/nvme/host/core.c +1 -0
@@ -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
Quoted 5 lines · Maurizio Lombardi
In
nvme_alloc_io_tag_set(), theconnect_qpointer should be set to NULL in case of error to avoid potential invalid pointer dereferences.Signed-off-by Maurizio Lombardi <[email protected]>---
Looks good.
Reviewed-by Chaitanya Kulkarni <[email protected]>
-ck
Thanks,
applied to nvme-6.2.