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


Groups > linux.kernel > #1450186

[PATCH 4.6 012/203] IB/rdmavt: Correct qp_priv_alloc() return value test

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.6 012/203] IB/rdmavt: Correct qp_priv_alloc() return value test
Date 2016-07-26 00:40 +0200
Message-ID <rYWHx-2cA-61@gated-at.bofh.it> (permalink)
References <rYVs7-1c6-53@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mike Marciniszyn <mike.marciniszyn@intel.com>

commit c755f4afa66ad3ed98870bd3254f37c47fb2c800 upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/infiniband/sw/rdmavt/qp.c |    4 +++-
 include/rdma/rdma_vt.h            |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -683,8 +683,10 @@ struct ib_qp *rvt_create_qp(struct ib_pd
 		 * 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)) /
--- a/include/rdma/rdma_vt.h
+++ b/include/rdma/rdma_vt.h
@@ -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);

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.6 000/203] 4.6.5-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:30 +0200
  [PATCH 4.6 017/203] powerpc/tm: Always reclaim in start_thread() for exec() class syscalls Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 014/203] powerpc/iommu: Remove the dependency on EEH struct in DDW mechanism Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 023/203] mnt: Account for MS_RDONLY in fs_fully_visible Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 022/203] mnt: fs_fully_visible test the proper mount for MNT_LOCKED Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 010/203] IB/core: Fix bit curruption in ib_device_cap_flags structure Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 018/203] usb: dwc2: fix regression on big-endian PowerPC/ARM systems Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 002/203] mac80211: fix fast_tx header alignment Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 012/203] IB/rdmavt: Correct qp_priv_alloc() return value test Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 019/203] USB: EHCI: declare hostpc register as zero-length array Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 013/203] IB/mlx4: Properly initialize GRH TClass and FlowLabel in AHs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 016/203] powerpc/pseries: Fix IBM_ARCH_VEC_NRCORES_OFFSET since POWER8NVL was added Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 025/203] of: fix autoloading due to broken modalias with no compatible Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 020/203] USB: dont free bandwidth_mutex too early Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  [PATCH 4.6 015/203] powerpc/pseries: Fix PCI config address for DDW Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 00:40 +0200
  Re: [PATCH 4.6 000/203] 4.6.5-stable review Shuah Khan <shuah.kh@samsung.com> - 2016-07-26 04:10 +0200
    Re: [PATCH 4.6 000/203] 4.6.5-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 04:50 +0200
  Re: [PATCH 4.6 000/203] 4.6.5-stable review Guenter Roeck <linux@roeck-us.net> - 2016-07-26 16:00 +0200
    Re: [PATCH 4.6 000/203] 4.6.5-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-26 16:30 +0200
      Re: [PATCH 4.6 000/203] 4.6.5-stable review Guenter Roeck <linux@roeck-us.net> - 2016-07-26 17:50 +0200
  Re: [PATCH 4.6 000/203] 4.6.5-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-07-27 06:50 +0200

csiph-web