From: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH] ibacm: Close MAD port when umad_register fails
Date: Tue, 19 Sep 2017 00:51:58 +0300 [thread overview]
Message-ID: <20170918215158.27597-1-yuval.shaia@oracle.com> (raw)
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
next reply other threads:[~2017-09-18 21:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 21:51 Yuval Shaia [this message]
[not found] ` <20170918215158.27597-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-09-18 21:55 ` [PATCH] ibacm: Close MAD port when umad_register fails 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170918215158.27597-1-yuval.shaia@oracle.com \
--to=yuval.shaia-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
--cc=hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).