linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ibacm: Close MAD port when umad_register fails
@ 2017-09-18 21:51 Yuval Shaia
       [not found] ` <20170918215158.27597-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Yuval Shaia @ 2017-09-18 21:51 UTC (permalink / raw)
  To: sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
	hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Yuval Shaia

Cleanup of the open port is needed when program fails to register MAD
port.

Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
 ibacm/src/acm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
index aba0deaa..0c0da7e9 100644
--- a/ibacm/src/acm.c
+++ b/ibacm/src/acm.c
@@ -2418,8 +2418,10 @@ acm_open_port(struct acmc_port *port, struct acmc_device *dev, uint8_t port_num)
 
 	port->mad_agentid = umad_register(port->mad_portid,
 					  IB_MGMT_CLASS_SA, 1, 1, NULL);
-	if (port->mad_agentid < 0)
+	if (port->mad_agentid < 0) {
+		umad_close_port(port->mad_portid);
 		acm_log(0, "ERROR - unable to register MAD client\n");
+	}
 
 	port->prov = NULL;
 	port->state = IBV_PORT_DOWN;
-- 
2.13.5

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2017-09-20 22:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-18 21:51 [PATCH] ibacm: Close MAD port when umad_register fails Yuval Shaia
     [not found] ` <20170918215158.27597-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-09-18 21:55   ` Jason Gunthorpe
     [not found]     ` <20170918215547.GB17476-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-09-20 22:30       ` Yuval Shaia
2017-09-20 22:50         ` Jason Gunthorpe
     [not found]           ` <20170920225012.GC20974-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-09-20 22:53             ` Yuval Shaia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).