Commit 90e7a4d5 authored by oulijun's avatar oulijun Committed by Doug Ledford

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: default avatarLijun Ou <oulijun@huawei.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 778cc5a8
...@@ -617,6 +617,8 @@ static void hns_roce_free_cmq_desc(struct hns_roce_dev *hr_dev, ...@@ -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, dma_unmap_single(hr_dev->dev, ring->desc_dma_addr,
ring->desc_num * sizeof(struct hns_roce_cmq_desc), ring->desc_num * sizeof(struct hns_roce_cmq_desc),
DMA_BIDIRECTIONAL); DMA_BIDIRECTIONAL);
ring->desc_dma_addr = 0;
kfree(ring->desc); kfree(ring->desc);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment