> -----Original Message----- > From: Stefan Metzmacher <metze@xxxxxxxxx> > Sent: Wednesday, 15 June 2022 17:27 > To: Bernard Metzler <BMT@xxxxxxxxxxxxxx>; linux-rdma@xxxxxxxxxxxxxxx > Cc: Stefan Metzmacher <metze@xxxxxxxxx> > Subject: [EXTERNAL] [PATCH v2 11/14] rdma/siw: use error and out logic at > the end of siw_connect() > > This will make the following changes easier. > > Fixes: 6c52fdc244b5 ("rdma/siw: connection management") > Signed-off-by: Stefan Metzmacher <metze@xxxxxxxxx> > Cc: Bernard Metzler <bmt@xxxxxxxxxxxxxx> > Cc: linux-rdma@xxxxxxxxxxxxxxx > --- > drivers/infiniband/sw/siw/siw_cm.c | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > > diff --git a/drivers/infiniband/sw/siw/siw_cm.c > b/drivers/infiniband/sw/siw/siw_cm.c > index 307494c6707a..66d90fc77cef 100644 > --- a/drivers/infiniband/sw/siw/siw_cm.c > +++ b/drivers/infiniband/sw/siw/siw_cm.c > @@ -1502,14 +1502,19 @@ int siw_connect(struct iw_cm_id *id, struct > iw_cm_conn_param *params) > cep->mpa.pdata = NULL; > } > > - if (rv >= 0) { > - rv = siw_cm_queue_work(cep, SIW_CM_WORK_MPATIMEOUT); > - if (!rv) { > - siw_dbg_cep(cep, "[QP %u]: exit\n", qp_id(qp)); > - siw_cep_set_free(cep); > - return 0; > - } > + if (rv < 0) { > + goto error; no brackets. > + } > + > + rv = siw_cm_queue_work(cep, SIW_CM_WORK_MPATIMEOUT); > + if (rv != 0) { > + goto error; no brackets > } > + > + siw_dbg_cep(cep, "[QP %u]: exit\n", qp_id(qp)); > + siw_cep_set_free(cep); > + return 0; > + > error: > siw_dbg(id->device, "failed: %d\n", rv); > > -- > 2.34.1