Skip to content

Commit 9292f8f

Browse files
Mike Marciniszynjgunthorpe
authored andcommitted
IB/hfi1: Correct guard on eager buffer deallocation
The code tests the dma address which legitimately can be 0. The code should test the kernel logical address to avoid leaking eager buffer allocations that happen to map to a dma address of 0. Fixes: 6036818 ("IB/hfi1: Fix user-space buffers mapping with IOMMU enabled") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent db6169b commit 9292f8f

File tree

1 file changed

+1
-1
lines changed
  • drivers/infiniband/hw/hfi1

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/hfi1/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ void hfi1_free_ctxtdata(struct hfi1_devdata *dd, struct hfi1_ctxtdata *rcd)
11201120
rcd->egrbufs.rcvtids = NULL;
11211121

11221122
for (e = 0; e < rcd->egrbufs.alloced; e++) {
1123-
if (rcd->egrbufs.buffers[e].dma)
1123+
if (rcd->egrbufs.buffers[e].addr)
11241124
dma_free_coherent(&dd->pcidev->dev,
11251125
rcd->egrbufs.buffers[e].len,
11261126
rcd->egrbufs.buffers[e].addr,

0 commit comments

Comments
 (0)