Commit b3a061d1 authored by Vegard Nossum's avatar Vegard Nossum Committed by Greg Kroah-Hartman

RDS: fix rds_tcp_init() error path

commit 3dad5424 upstream.

If register_pernet_subsys() fails, we shouldn't try to call
unregister_pernet_subsys().

Fixes: 467fa153 ("RDS-TCP: Support multiple RDS-TCP listen endpoints, one per netns.")
Cc: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
Acked-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d9e1886b
...@@ -421,7 +421,7 @@ static int rds_tcp_init(void) ...@@ -421,7 +421,7 @@ static int rds_tcp_init(void)
ret = rds_tcp_recv_init(); ret = rds_tcp_recv_init();
if (ret) if (ret)
goto out_slab; goto out_pernet;
ret = rds_trans_register(&rds_tcp_transport); ret = rds_trans_register(&rds_tcp_transport);
if (ret) if (ret)
...@@ -433,8 +433,9 @@ static int rds_tcp_init(void) ...@@ -433,8 +433,9 @@ static int rds_tcp_init(void)
out_recv: out_recv:
rds_tcp_recv_exit(); rds_tcp_recv_exit();
out_slab: out_pernet:
unregister_pernet_subsys(&rds_tcp_net_ops); unregister_pernet_subsys(&rds_tcp_net_ops);
out_slab:
kmem_cache_destroy(rds_tcp_conn_slab); kmem_cache_destroy(rds_tcp_conn_slab);
out: out:
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment