From: Ursula Braun <ubraun@linux.ibm.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
gor@linux.ibm.com, heiko.carstens@de.ibm.com,
raspl@linux.ibm.com, kgraul@linux.ibm.com, ubraun@linux.ibm.com,
zhp@smail.nju.edu.cn, yuehaibing@huawei.com
Subject: [PATCH net 2/2] net/smc: Fix error path in smc_init
Date: Wed, 26 Jun 2019 17:47:50 +0200 [thread overview]
Message-ID: <20190626154750.46127-3-ubraun@linux.ibm.com> (raw)
In-Reply-To: <20190626154750.46127-1-ubraun@linux.ibm.com>
From: YueHaibing <yuehaibing@huawei.com>
If register_pernet_subsys success in smc_init,
we should cleanup it in case any other error.
Fixes: 64e28b52c7a6 (net/smc: add pnet table namespace support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
---
net/smc/af_smc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 0c874e996f85..7621ec2f539c 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -2029,7 +2029,7 @@ static int __init smc_init(void)
rc = smc_pnet_init();
if (rc)
- return rc;
+ goto out_pernet_subsys;
rc = smc_llc_init();
if (rc) {
@@ -2080,6 +2080,9 @@ static int __init smc_init(void)
proto_unregister(&smc_proto);
out_pnet:
smc_pnet_exit();
+out_pernet_subsys:
+ unregister_pernet_subsys(&smc_net_ops);
+
return rc;
}
--
2.17.1
next prev parent reply other threads:[~2019-06-26 15:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 15:47 [PATCH net 0/2] net/smc: fixes 2019-06-26 Ursula Braun
2019-06-26 15:47 ` [PATCH net 1/2] net/smc: hold conns_lock before calling smc_lgr_register_conn() Ursula Braun
2019-06-26 15:47 ` Ursula Braun [this message]
2019-06-26 17:10 ` [PATCH net 0/2] net/smc: fixes 2019-06-26 David Miller
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=20190626154750.46127-3-ubraun@linux.ibm.com \
--to=ubraun@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=gor@linux.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=kgraul@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raspl@linux.ibm.com \
--cc=yuehaibing@huawei.com \
--cc=zhp@smail.nju.edu.cn \
/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