aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
authorSean Hefty <sean.hefty@intel.com>2013-07-24 18:06:09 -0400
committerRoland Dreier <roland@purestorage.com>2013-07-31 03:50:44 -0400
commit5eb695c1773b439fb668127d3738d348a46a2748 (patch)
treea2651e2036603b9543676aae4064603f2ff4bbd9 /drivers/infiniband/core
parente511d1ae16745baca1e6d807c5b963716e8bdd01 (diff)
RDMA/cma: Only call cma_save_ib_info() for CM REQs
Calling cma_save_ib_info() for CM SIDR REQs results in a crash accessing an invalid path record pointer. Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/cma.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 431465563364..7c0f9535fb7d 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -879,7 +879,8 @@ static int cma_save_net_info(struct rdma_cm_id *id, struct rdma_cm_id *listen_id
879{ 879{
880 struct cma_hdr *hdr; 880 struct cma_hdr *hdr;
881 881
882 if (listen_id->route.addr.src_addr.ss_family == AF_IB) { 882 if ((listen_id->route.addr.src_addr.ss_family == AF_IB) &&
883 (ib_event->event == IB_CM_REQ_RECEIVED)) {
883 cma_save_ib_info(id, listen_id, ib_event->param.req_rcvd.primary_path); 884 cma_save_ib_info(id, listen_id, ib_event->param.req_rcvd.primary_path);
884 return 0; 885 return 0;
885 } 886 }