aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Metzler <[email protected]>2019-08-19 16:02:57 +0200
committerDoug Ledford <[email protected]>2019-08-20 13:44:44 -0400
commit9b440078017f194e56eaae3ac32f333f420c5c4e (patch)
tree2740857561f5a6e4173c55d2d66f05c0328a61dc
parent27b7fb1ab7bfad45f5702ff0c78a4822a41b1456 (diff)
RDMA/siw: Fix potential NULL de-ref
In siw_connect() we have an error flow where there is no valid qp pointer. Make sure we don't try to de-ref in that situation. Fixes: 6c52fdc244b5 ("rdma/siw: connection management") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Bernard Metzler <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Doug Ledford <[email protected]>
-rw-r--r--drivers/infiniband/sw/siw/siw_cm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c
index 9ce8a1b925d2..fc97571a640b 100644
--- a/drivers/infiniband/sw/siw/siw_cm.c
+++ b/drivers/infiniband/sw/siw/siw_cm.c
@@ -1515,7 +1515,7 @@ int siw_connect(struct iw_cm_id *id, struct iw_cm_conn_param *params)
}
}
error:
- siw_dbg_qp(qp, "failed: %d\n", rv);
+ siw_dbg(id->device, "failed: %d\n", rv);
if (cep) {
siw_socket_disassoc(s);
@@ -1540,7 +1540,8 @@ error:
} else if (s) {
sock_release(s);
}
- siw_qp_put(qp);
+ if (qp)
+ siw_qp_put(qp);
return rv;
}