diff mbox series

[v2,02/14] rdma/siw: make siw_cm_upcall() a noop without valid 'id'

Message ID bc7368632a151ba00d5932a951f128e344189b27.1655305567.git.metze@samba.org (mailing list archive)
State Changes Requested
Headers show
Series rdma/siw: implement non-blocking connect | expand

Commit Message

Stefan Metzmacher June 15, 2022, 3:26 p.m. UTC
This will simplify the callers.

Fixes: 6c52fdc244b5 ("rdma/siw: connection management")
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Cc: Bernard Metzler <bmt@zurich.ibm.com>
Cc: linux-rdma@vger.kernel.org
---
 drivers/infiniband/sw/siw/siw_cm.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c
index a8e546670d05..eeb366edba2a 100644
--- a/drivers/infiniband/sw/siw/siw_cm.c
+++ b/drivers/infiniband/sw/siw/siw_cm.c
@@ -322,6 +322,9 @@  static int siw_cm_upcall(struct siw_cep *cep, enum iw_cm_event_type reason,
 	} else {
 		id = cep->cm_id;
 	}
+	if (id == NULL)
+		return status;
+
 	/* Signal IRD and ORD */
 	if (reason == IW_CM_EVENT_ESTABLISHED ||
 	    reason == IW_CM_EVENT_CONNECT_REPLY) {