diff options
author | oulijun <oulijun@huawei.com> | 2018-05-04 04:57:10 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2018-05-09 16:45:18 +0200 |
commit | 90e7a4d5066240b75cdfd1bf8944ca36622153b1 (patch) | |
tree | d670c2f9233ee4f5714bd9c185ab16fb6deff5ad /drivers | |
parent | RDMA/hns: Fix the bug with rq sge (diff) | |
download | linux-90e7a4d5066240b75cdfd1bf8944ca36622153b1.tar.xz linux-90e7a4d5066240b75cdfd1bf8944ca36622153b1.zip |
RDMA/hns: Set desc_dma_addr for zero when free cmq desc
In order to avoid illegal use for desc_dma_addr of ring,
it needs to set it zero when free cmq desc.
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index a40978bbc1d0..46c3ab97e1ba 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -617,6 +617,8 @@ static void hns_roce_free_cmq_desc(struct hns_roce_dev *hr_dev, dma_unmap_single(hr_dev->dev, ring->desc_dma_addr, ring->desc_num * sizeof(struct hns_roce_cmq_desc), DMA_BIDIRECTIONAL); + + ring->desc_dma_addr = 0; kfree(ring->desc); } |