mirror of
https://github.com/torvalds/linux.git
synced 2024-12-23 19:31:53 +00:00
RDMA/ocrdma: Fix an error code in ocrdma_alloc_pd()
We should preserve the original "status" error code instead of resetting
it to zero. Returning ERR_PTR(0) is the same as NULL and results in a
NULL dereference in the callers. I added a printk() on error instead.
Fixes: 45e86b33ec
("RDMA/ocrdma: Cache recv DB until QP moved to RTR")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
9064d6055c
commit
dd75cfa6d3
@ -744,7 +744,8 @@ err:
|
||||
if (is_uctx_pd) {
|
||||
ocrdma_release_ucontext_pd(uctx);
|
||||
} else {
|
||||
status = _ocrdma_dealloc_pd(dev, pd);
|
||||
if (_ocrdma_dealloc_pd(dev, pd))
|
||||
pr_err("%s: _ocrdma_dealloc_pd() failed\n", __func__);
|
||||
}
|
||||
exit:
|
||||
return ERR_PTR(status);
|
||||
|
Loading…
Reference in New Issue
Block a user