linux/drivers/infiniband/core
shefty 63f05be2c0 RDMA/cm: Change return value from find_gid_port()
Problem reported by Dan Carpenter <dan.carpenter@oracle.com>:

The patch 3c86aa70bf: "RDMA/cm: Add RDMA CM support for IBoE
devices" from Oct 13, 2010, leads to the following warning:
net/sunrpc/xprtrdma/svc_rdma_transport.c:722 svc_rdma_create()
	 error: passing non neg 1 to ERR_PTR

This bug would result in a NULL dereference.  svc_rdma_create() is
supposed to return ERR_PTRs or valid pointers, but instead it returns
ERR_PTRs, valid pointers and 1.

The call tree is:

svc_rdma_create()
   => rdma_bind_addr()
      => cma_acquire_dev()
         => find_gid_port()

rdma_bind_addr() should return a valid errno.  Fix this by having
find_gid_port() also return a valid errno.  If we can't find the
specified GID on a given port, return -EADDRNOTAVAIL, rather than
-EAGAIN, to better indicate the error.  We also drop using the
special return value of '1' and instead pass through the error
returned by the underlying verbs call.  On such errors, rather
than aborting the search,  we simply continue to check the next
device/port.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2012-11-29 12:16:29 -08:00
..
addr.c workqueue: use mod_delayed_work() instead of cancel + queue 2012-08-13 16:27:37 -07:00
agent.c
agent.h
cache.c IB/core: Add ib_find_exact_cached_pkey() 2012-09-30 20:33:30 -07:00
cm_msgs.h IB/core: Move CM_xxx_ATTR_ID macros from cm_msgs.h to ib_cm.h 2012-07-08 18:05:06 -07:00
cm.c idr: rename MAX_LEVEL to MAX_IDR_LEVEL 2012-10-06 03:04:56 +09:00
cma.c RDMA/cm: Change return value from find_gid_port() 2012-11-29 12:16:29 -08:00
core_priv.h
device.c IB/core: Handle table with full and partial membership for the same P_Key 2012-09-30 20:33:29 -07:00
fmr_pool.c
iwcm.c
iwcm.h
mad_priv.h
mad_rmpp.c
mad_rmpp.h
mad.c workqueue: deprecate __cancel_delayed_work() 2012-08-21 13:18:24 -07:00
Makefile
multicast.c
netlink.c infiniband: pass rdma_cm module to netlink_dump_start 2012-10-07 00:30:56 -04:00
packer.c
sa_query.c IB/sa: Add GuidInfoRecord query support 2012-07-08 18:05:06 -07:00
sa.h
smi.c
smi.h
sysfs.c IB/core: Don't return EINVAL from sysfs rate attribute for invalid speeds 2012-04-02 10:57:31 -07:00
ucm.c IB/core: Remove unused variables in ucm/ucma 2012-09-30 20:31:46 -07:00
ucma.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2012-10-02 20:25:04 -07:00
ud_header.c
umem.c IB/core: Fix mismatch between locked and pinned pages 2012-05-11 11:38:22 -07:00
user_mad.c
uverbs_cmd.c switch simple cases of fget_light to fdget 2012-09-26 22:20:08 -04:00
uverbs_main.c switch simple cases of fget_light to fdget 2012-09-26 22:20:08 -04:00
uverbs_marshall.c
uverbs.h
verbs.c Merge branches 'core', 'cxgb4', 'ipath', 'iser', 'lockdep', 'mlx4', 'nes', 'ocrdma', 'qib' and 'raw-qp' into for-linus 2012-05-21 09:00:47 -07:00