summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Pravin <francis.p@samsung.com>2025-01-17 05:12:09 +0530
committerKeith Busch <kbusch@kernel.org>2025-01-17 11:16:34 -0800
commitd68fc95a771e0a7edd876ede7913d61276be77fd (patch)
treec6a8d3f9e773563e562936518c09d1e12dae4b45
parent3c47c2ccd5a29c78780ccfd0227a805f3873ab1c (diff)
nvme-pci: remove redundant dma frees in hmb
The value of size is 0 when there is no dma buffer allocated. The value of i also remains 0. So, no need to free the dma buffer in out_free_bufs. Hence, remove the redundant dma frees. Signed-off-by: Francis Pravin <francis.p@samsung.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
-rw-r--r--drivers/nvme/host/pci.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index fe0795e16e25..a14f3c74b717 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2153,14 +2153,6 @@ static int nvme_alloc_host_mem_multi(struct nvme_dev *dev, u64 preferred,
return 0;
out_free_bufs:
- while (--i >= 0) {
- size_t size = le32_to_cpu(descs[i].size) * NVME_CTRL_PAGE_SIZE;
-
- dma_free_attrs(dev->dev, size, bufs[i],
- le64_to_cpu(descs[i].addr),
- DMA_ATTR_NO_KERNEL_MAPPING | DMA_ATTR_NO_WARN);
- }
-
kfree(bufs);
out_free_descs:
dma_free_coherent(dev->dev, descs_size, descs, descs_dma);