diff options
author | Mike Marciniszyn <mike.marciniszyn@intel.com> | 2016-06-22 22:29:33 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-06-23 16:16:15 +0200 |
commit | c755f4afa66ad3ed98870bd3254f37c47fb2c800 (patch) | |
tree | a395969f595da0bcc305d2b4400a7462402832bc /drivers/infiniband | |
parent | IB/hfi1: Don't zero out qp->s_ack_queue in rvt_reset_qp (diff) | |
download | linux-c755f4afa66ad3ed98870bd3254f37c47fb2c800.tar.xz linux-c755f4afa66ad3ed98870bd3254f37c47fb2c800.zip |
IB/rdmavt: Correct qp_priv_alloc() return value test
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.
Cc: Stable <stable@vger.kernel.org> # 4.6+
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/sw/rdmavt/qp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c index d04f4fe522b5..41ba7e9cadaa 100644 --- a/drivers/infiniband/sw/rdmavt/qp.c +++ b/drivers/infiniband/sw/rdmavt/qp.c @@ -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)) / |