Skip to content

Commit d71872a

Browse files
vegardgregkh
authored andcommitted
RDS: fix rds_tcp_init() error path
commit 3dad542 upstream. If register_pernet_subsys() fails, we shouldn't try to call unregister_pernet_subsys(). Fixes: 467fa15 ("RDS-TCP: Support multiple RDS-TCP listen endpoints, one per netns.") Cc: Sowmini Varadhan <[email protected]> Cc: David S. Miller <[email protected]> Signed-off-by: Vegard Nossum <[email protected]> Acked-by: Sowmini Varadhan <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f3f8ae8 commit d71872a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/rds/tcp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ static int rds_tcp_init(void)
544544

545545
ret = rds_tcp_recv_init();
546546
if (ret)
547-
goto out_slab;
547+
goto out_pernet;
548548

549549
ret = rds_trans_register(&rds_tcp_transport);
550550
if (ret)
@@ -556,8 +556,9 @@ static int rds_tcp_init(void)
556556

557557
out_recv:
558558
rds_tcp_recv_exit();
559-
out_slab:
559+
out_pernet:
560560
unregister_pernet_subsys(&rds_tcp_net_ops);
561+
out_slab:
561562
kmem_cache_destroy(rds_tcp_conn_slab);
562563
out:
563564
return ret;

0 commit comments

Comments
 (0)