Skip to content

Commit 3d69191

Browse files
tititiou36dledford
authored andcommitted
iw_cxgb4: Fix an error handling path in 'c4iw_get_dma_mr()'
The error handling path of 'c4iw_get_dma_mr()' does not free resources in the correct order. If an error occures, it can leak 'mhp->wr_waitp'. Fixes: a3f12da ("iw_cxgb4: allocate wait object for each memory object") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 4373175 commit 3d69191

File tree

1 file changed

+2
-2
lines changed
  • drivers/infiniband/hw/cxgb4

1 file changed

+2
-2
lines changed

drivers/infiniband/hw/cxgb4/mem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,10 @@ struct ib_mr *c4iw_get_dma_mr(struct ib_pd *pd, int acc)
489489
err_dereg_mem:
490490
dereg_mem(&rhp->rdev, mhp->attr.stag, mhp->attr.pbl_size,
491491
mhp->attr.pbl_addr, mhp->dereg_skb, mhp->wr_waitp);
492-
err_free_wr_wait:
493-
c4iw_put_wr_wait(mhp->wr_waitp);
494492
err_free_skb:
495493
kfree_skb(mhp->dereg_skb);
494+
err_free_wr_wait:
495+
c4iw_put_wr_wait(mhp->wr_waitp);
496496
err_free_mhp:
497497
kfree(mhp);
498498
return ERR_PTR(ret);

0 commit comments

Comments
 (0)