diff options
author | Prabhath Sajeepa <psajeepa@purestorage.com> | 2018-11-28 21:11:29 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-11-30 19:23:23 +0300 |
commit | 6344d02dc8f886b6bbcd922ae1a17e4a41500f2d (patch) | |
tree | 4218580933ba66ea2ec7ebe0da102e1b96ee7b66 /drivers/nvme/host | |
parent | f6c8e432cb0479255322c5d0335b9f1699a0270c (diff) | |
download | linux-6344d02dc8f886b6bbcd922ae1a17e4a41500f2d.tar.xz |
nvme-rdma: fix double freeing of async event data
Some error paths in configuration of admin queue free data buffer
associated with async request SQE without resetting the data buffer
pointer to NULL, This buffer is also freed up again if the controller
is shutdown or reset.
Signed-off-by: Prabhath Sajeepa <psajeepa@purestorage.com>
Reviewed-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host')
-rw-r--r-- | drivers/nvme/host/rdma.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index d181cafedc58..ab6ec7295bf9 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -184,6 +184,7 @@ static int nvme_rdma_alloc_qe(struct ib_device *ibdev, struct nvme_rdma_qe *qe, qe->dma = ib_dma_map_single(ibdev, qe->data, capsule_size, dir); if (ib_dma_mapping_error(ibdev, qe->dma)) { kfree(qe->data); + qe->data = NULL; return -ENOMEM; } @@ -823,6 +824,7 @@ out_free_tagset: out_free_async_qe: nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe, sizeof(struct nvme_command), DMA_TO_DEVICE); + ctrl->async_event_sqe.data = NULL; out_free_queue: nvme_rdma_free_queue(&ctrl->queues[0]); return error; |