IB/rdmavt: Correct qp_priv_alloc() return value test
Subsystems (3)
PATCH 1/1 IB/rdmavt: Correct qp_priv_alloc() return value test
From: Mike Marciniszyn <[email protected]>
The current drivers return errors from this calldown wrapped in an ERR_PTR().
The rdmavt code incorrectly tests for NULL.
The code is fixed to use IS_ERR() and change ret according to the driver return value.
--- drivers/infiniband/sw/rdmavt/qp.c | 4 +++- include/rdma/rdma_vt.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/infiniband/sw/rdmavt/qp.c +3 -1
@@ -699,8 +699,10 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,* initialization that is needed. */ priv = rdi->driver_f.qp_priv_alloc (rdi, qp, gfp); -if (!priv) +if (IS_ERR (priv)) { + ret = priv; goto bail_qp; + } qp->priv = priv; qp->timeout_jiffies = usecs_to_jiffies((4096UL * (1UL << qp->timeout)) /
include/rdma/rdma_vt.h +3 -1
@@ -203,7 +203,9 @@ struct rvt_driver_provided {/* * Allocate a private queue pair data structure for driver specific -* information which is opaque to rdmavt. +* information which is opaque to rdmavt. Errors are returned via +* ERR_PTR(err). The driver is free to return NULL or a valid +* pointer. */ void * (*qp_priv_alloc)(struct rvt_dev_info *rdi,struct rvt_qp *qp,gfp_t gfp);
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Doug Ledford
AppliedQuoted 7 lines · Dennis Dalessandro
From: Mike Marciniszyn <[email protected]>
The current drivers return errors from this calldown wrapped in an
ERR_PTR().The rdmavt code incorrectly tests for NULL.
Quoted 7 lines
The code is fixed to use
IS_ERR()and change ret according to the driver return value.Cc Stable <[email protected]> # 4.6+Reviewed-by Dennis Dalessandro <[email protected]>Signed-off-by Mike Marciniszyn <[email protected]>Signed-off-by Dennis Dalessandro <[email protected]>
Thanks, applied.
Signature · 2 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD