Skip to content

Commit 8c33bf1

Browse files
YueHaibingdavem330
authored andcommitted
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: 64e28b5 (net/smc: add pnet table namespace support") Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Ursula Braun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4480879 commit 8c33bf1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/smc/af_smc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2029,7 +2029,7 @@ static int __init smc_init(void)
20292029

20302030
rc = smc_pnet_init();
20312031
if (rc)
2032-
return rc;
2032+
goto out_pernet_subsys;
20332033

20342034
rc = smc_llc_init();
20352035
if (rc) {
@@ -2080,6 +2080,9 @@ static int __init smc_init(void)
20802080
proto_unregister(&smc_proto);
20812081
out_pnet:
20822082
smc_pnet_exit();
2083+
out_pernet_subsys:
2084+
unregister_pernet_subsys(&smc_net_ops);
2085+
20832086
return rc;
20842087
}
20852088

0 commit comments

Comments
 (0)