Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1686331 > unrolled thread

[PATCH 1/2] RDMA/ocrdma: Fix an error code in ocrdma_alloc_pd()

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2017-07-13 09:50 +0200
Last post2017-07-13 09:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] RDMA/ocrdma: Fix an error code in ocrdma_alloc_pd() Dan Carpenter <dan.carpenter@oracle.com> - 2017-07-13 09:50 +0200

#1686331 — [PATCH 1/2] RDMA/ocrdma: Fix an error code in ocrdma_alloc_pd()

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-07-13 09:50 +0200
Subject[PATCH 1/2] RDMA/ocrdma: Fix an error code in ocrdma_alloc_pd()
Message-ID<u2H2O-2IC-31@gated-at.bofh.it>
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: 45e86b33ec8b ("RDMA/ocrdma: Cache recv DB until QP moved to RTR")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 2f30bda8457a..cc317e858040 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -744,7 +744,8 @@ struct ib_pd *ocrdma_alloc_pd(struct ib_device *ibdev,
 	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);

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web