Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH] siw: Fix potential NULL pointer in siw_connect().
@ 2019-08-19 14:02 Bernard Metzler
  2019-08-20 16:05 ` Doug Ledford
  0 siblings, 1 reply; 11+ messages in thread
From: Bernard Metzler @ 2019-08-19 14:02 UTC (permalink / raw)
  To: linux-rdma; +Cc: dan.carpenter, jgg, Bernard Metzler

Fixes: 6c52fdc244b5 ("rdma/siw: connection management")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
---
 drivers/infiniband/sw/siw/siw_cm.c | 5 +++--
 1 file 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 @@ int siw_connect(struct iw_cm_id *id, struct iw_cm_conn_param *params)
 	} else if (s) {
 		sock_release(s);
 	}
-	siw_qp_put(qp);
+	if (qp)
+		siw_qp_put(qp);
 
 	return rv;
 }
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-08-22 15:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-19 14:02 [PATCH] siw: Fix potential NULL pointer in siw_connect() Bernard Metzler
2019-08-20 16:05 ` Doug Ledford
2019-08-20 16:11   ` Bernard Metzler
2019-08-21 12:56   ` Dan Carpenter
2019-08-21 13:39     ` Doug Ledford
2019-08-21 14:12       ` Jason Gunthorpe
2019-08-21 16:30         ` Leon Romanovsky
2019-08-22  6:35         ` Gal Pressman
2019-08-22  7:10         ` Dan Carpenter
2019-08-22 12:02           ` Jason Gunthorpe
2019-08-22 15:02             ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox