mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
RDMA/hns: ensure for-loop actually iterates and free's buffers
The current for-loop zeros variable i and only loops once, hence
not all the buffers are free'd. Fix this by setting i correctly.
Detected by CoverityScan, CID#1463415 ("Operands don't affect result")
Fixes: a5073d6054
("RDMA/hns: Add eq support of hip08")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Yixian Liu <liuyixian@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
c8d3bcbfc5
commit
38759d6175
@ -4383,7 +4383,7 @@ err_dma_alloc_buf:
|
||||
eq->l0_dma = 0;
|
||||
|
||||
if (mhop_num == 1)
|
||||
for (i -= i; i >= 0; i--)
|
||||
for (i -= 1; i >= 0; i--)
|
||||
dma_free_coherent(dev, buf_chk_sz, eq->buf[i],
|
||||
eq->buf_dma[i]);
|
||||
else if (mhop_num == 2) {
|
||||
|
Loading…
Reference in New Issue
Block a user