Skip to content

Commit d68fc95

Browse files
francispravin5keithbusch
authored andcommitted
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 3c47c2c commit d68fc95

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

drivers/nvme/host/pci.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,14 +2153,6 @@ static int nvme_alloc_host_mem_multi(struct nvme_dev *dev, u64 preferred,
21532153
return 0;
21542154

21552155
out_free_bufs:
2156-
while (--i >= 0) {
2157-
size_t size = le32_to_cpu(descs[i].size) * NVME_CTRL_PAGE_SIZE;
2158-
2159-
dma_free_attrs(dev->dev, size, bufs[i],
2160-
le64_to_cpu(descs[i].addr),
2161-
DMA_ATTR_NO_KERNEL_MAPPING | DMA_ATTR_NO_WARN);
2162-
}
2163-
21642156
kfree(bufs);
21652157
out_free_descs:
21662158
dma_free_coherent(dev->dev, descs_size, descs, descs_dma);

0 commit comments

Comments
 (0)