Skip to content

Commit

Permalink
net/smc: Fix error path in smc_init
Browse files Browse the repository at this point in the history
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 <yuehaibing@huawei.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
YueHaibing authored and davem330 committed Jun 26, 2019
1 parent 4480879 commit 8c33bf1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/smc/af_smc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 8c33bf1

Please sign in to comment.