Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32c631f9 authored by Thadeu Lima de Souza Cascardo's avatar Thadeu Lima de Souza Cascardo Committed by Roland Dreier
Browse files

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: default avatarThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent ddffeb8c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -468,7 +468,7 @@ struct ib_mr *c4iw_register_phys_mem(struct ib_pd *pd,
	ret = alloc_pbl(mhp, npages);
	ret = alloc_pbl(mhp, npages);
	if (ret) {
	if (ret) {
		kfree(page_list);
		kfree(page_list);
		goto err_pbl;
		goto err;
	}
	}


	ret = write_pbl(&mhp->rhp->rdev, page_list, mhp->attr.pbl_addr,
	ret = write_pbl(&mhp->rhp->rdev, page_list, mhp->attr.pbl_addr,