diff options
author | Maurizio Lombardi <mlombard@redhat.com> | 2023-01-31 19:38:42 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2023-02-01 16:18:46 +0300 |
commit | 6fbf13c0e24fd86ab2e4477cd8484a485b687421 (patch) | |
tree | f37bec06abb0db4ed0b435ea3e228798cb6abd51 /drivers/nvme | |
parent | fd62678ab55cb01e11a404d302cdade222bf4022 (diff) | |
download | linux-6fbf13c0e24fd86ab2e4477cd8484a485b687421.tar.xz |
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 <mlombard@redhat.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 1c333ce64bd4..c777f56a9e74 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4956,6 +4956,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); |