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 <cascardo@linux.vnet.ibm.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
ret = alloc_pbl(mhp, npages);
if (ret) {
kfree(page_list);
ret = alloc_pbl(mhp, npages);
if (ret) {
kfree(page_list);
}
ret = write_pbl(&mhp->rhp->rdev, page_list, mhp->attr.pbl_addr,
}
ret = write_pbl(&mhp->rhp->rdev, page_list, mhp->attr.pbl_addr,