Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c33bf1b authored by YueHaibing's avatar YueHaibing Committed by David S. Miller
Browse files

net/smc: Fix error path in smc_init



If register_pernet_subsys success in smc_init,
we should cleanup it in case any other error.

Fixes: 64e28b52 (net/smc: add pnet table namespace support")
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 44808792
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;
}