diff options
author | James Smart <jsmart2021@gmail.com> | 2018-10-27 15:41:54 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-11-02 10:14:45 -0400 |
commit | d19b8bc82fc232d17ec45ca148388e4ba05ac4b9 (patch) | |
tree | ebe45567a8f479d13799b88b03622a82e6360585 | |
parent | b5f2954d30c77649bce9c27e7a0a94299d9cfdf8 (diff) |
nvme-fc: fix request private initialization
The patch made to avoid Coverity reporting of out of bounds access
on aen_op moved the assignment of a pointer, leaving it null when it
was subsequently used to calculate a private pointer. Thus the private
pointer was bad.
Move/correct the private pointer initialization to be in sync with the
patch.
Fixes: 0d2bdf9f4134 ("nvme-fc: rework the request initialization code")
Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/nvme/host/fc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index e52b9d3c0bd6..0b70c8bab045 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c | |||
@@ -1704,7 +1704,6 @@ __nvme_fc_init_request(struct nvme_fc_ctrl *ctrl, | |||
1704 | op->fcp_req.rspaddr = &op->rsp_iu; | 1704 | op->fcp_req.rspaddr = &op->rsp_iu; |
1705 | op->fcp_req.rsplen = sizeof(op->rsp_iu); | 1705 | op->fcp_req.rsplen = sizeof(op->rsp_iu); |
1706 | op->fcp_req.done = nvme_fc_fcpio_done; | 1706 | op->fcp_req.done = nvme_fc_fcpio_done; |
1707 | op->fcp_req.private = &op->fcp_req.first_sgl[SG_CHUNK_SIZE]; | ||
1708 | op->ctrl = ctrl; | 1707 | op->ctrl = ctrl; |
1709 | op->queue = queue; | 1708 | op->queue = queue; |
1710 | op->rq = rq; | 1709 | op->rq = rq; |
@@ -1752,6 +1751,7 @@ nvme_fc_init_request(struct blk_mq_tag_set *set, struct request *rq, | |||
1752 | if (res) | 1751 | if (res) |
1753 | return res; | 1752 | return res; |
1754 | op->op.fcp_req.first_sgl = &op->sgl[0]; | 1753 | op->op.fcp_req.first_sgl = &op->sgl[0]; |
1754 | op->op.fcp_req.private = &op->priv[0]; | ||
1755 | return res; | 1755 | return res; |
1756 | } | 1756 | } |
1757 | 1757 | ||