summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLijun Ou <oulijun@huawei.com>2019-10-26 02:56:35 -0400
committerJason Gunthorpe <jgg@mellanox.com>2019-10-28 14:06:38 -0400
commitb681a0529968d2261aa15d7a1e78801b2c06bb07 (patch)
tree08d2cc07c46e1d047a8afa6be7e7a85eda00a7ec
parentd4934f45693651ea15357dd6c7c36be28b6da884 (diff)
RDMA/hns: Prevent memory leaks of eq->buf_list
eq->buf_list->buf and eq->buf_list should also be freed when eqe_hop_num is set to 0, or there will be memory leaks. Fixes: a5073d6054f7 ("RDMA/hns: Add eq support of hip08") Link: https://lore.kernel.org/r/1572072995-11277-3-git-send-email-liweihang@hisilicon.com Signed-off-by: Lijun Ou <oulijun@huawei.com> Signed-off-by: Weihang Li <liweihang@hisilicon.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 7a89d669f8bf..e82567fcdeb7 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -5389,9 +5389,9 @@ static void hns_roce_v2_free_eq(struct hns_roce_dev *hr_dev,
5389 return; 5389 return;
5390 } 5390 }
5391 5391
5392 if (eq->buf_list) 5392 dma_free_coherent(hr_dev->dev, buf_chk_sz, eq->buf_list->buf,
5393 dma_free_coherent(hr_dev->dev, buf_chk_sz, 5393 eq->buf_list->map);
5394 eq->buf_list->buf, eq->buf_list->map); 5394 kfree(eq->buf_list);
5395} 5395}
5396 5396
5397static void hns_roce_config_eqc(struct hns_roce_dev *hr_dev, 5397static void hns_roce_config_eqc(struct hns_roce_dev *hr_dev,