Commit dd75cfa6 authored by Dan Carpenter's avatar Dan Carpenter Committed by Doug Ledford

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: 45e86b33 ("RDMA/ocrdma: Cache recv DB until QP moved to RTR")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 9064d605
...@@ -744,7 +744,8 @@ struct ib_pd *ocrdma_alloc_pd(struct ib_device *ibdev, ...@@ -744,7 +744,8 @@ struct ib_pd *ocrdma_alloc_pd(struct ib_device *ibdev,
if (is_uctx_pd) { if (is_uctx_pd) {
ocrdma_release_ucontext_pd(uctx); ocrdma_release_ucontext_pd(uctx);
} else { } else {
status = _ocrdma_dealloc_pd(dev, pd); if (_ocrdma_dealloc_pd(dev, pd))
pr_err("%s: _ocrdma_dealloc_pd() failed\n", __func__);
} }
exit: exit:
return ERR_PTR(status); return ERR_PTR(status);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment