Skip to content

Commit 6fbf13c

Browse files
maurizio-lombardiChristoph Hellwig
authored andcommitted
nvme: clear the request_queue pointers on failure in nvme_alloc_io_tag_set
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]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent fd62678 commit 6fbf13c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/nvme/host/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4956,6 +4956,7 @@ int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
49564956

49574957
out_free_tag_set:
49584958
blk_mq_free_tag_set(set);
4959+
ctrl->connect_q = NULL;
49594960
return ret;
49604961
}
49614962
EXPORT_SYMBOL_GPL(nvme_alloc_io_tag_set);

0 commit comments

Comments
 (0)