From: Thadeu Lima de Souza Cascardo Date: Fri, 12 Oct 2012 21:10:11 +0000 (+0000) Subject: RDMA/cxgb4: Don't free chunk that we have failed to allocate X-Git-Tag: Ubuntu-5.10.0-12.13~20339^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=32c631f9f2566d09d32abc2f4c7aa24c6d8b5641;p=mirror_ubuntu-hirsute-kernel.git RDMA/cxgb4: Don't free chunk that we have failed to allocate In the error path of registering memory when there's a failure to allocate a chunk from the memory pool, we try to free the same chunk we just failed to allocate, which will BUG(). Signed-off-by: Thadeu Lima de Souza Cascardo Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c index 57e07c61ace2..afd81790ab3c 100644 --- a/drivers/infiniband/hw/cxgb4/mem.c +++ b/drivers/infiniband/hw/cxgb4/mem.c @@ -468,7 +468,7 @@ struct ib_mr *c4iw_register_phys_mem(struct ib_pd *pd, ret = alloc_pbl(mhp, npages); if (ret) { kfree(page_list); - goto err_pbl; + goto err; } ret = write_pbl(&mhp->rhp->rdev, page_list, mhp->attr.pbl_addr,