Skip to content

Commit 3dad542

Browse files
vegarddavem330
authored andcommitted
RDS: fix rds_tcp_init() error path
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: [email protected] 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]>
1 parent d5d5e8d commit 3dad542

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
@@ -616,7 +616,7 @@ static int rds_tcp_init(void)
616616

617617
ret = rds_tcp_recv_init();
618618
if (ret)
619-
goto out_slab;
619+
goto out_pernet;
620620

621621
ret = rds_trans_register(&rds_tcp_transport);
622622
if (ret)
@@ -628,8 +628,9 @@ static int rds_tcp_init(void)
628628

629629
out_recv:
630630
rds_tcp_recv_exit();
631-
out_slab:
631+
out_pernet:
632632
unregister_pernet_subsys(&rds_tcp_net_ops);
633+
out_slab:
633634
kmem_cache_destroy(rds_tcp_conn_slab);
634635
out:
635636
return ret;

0 commit comments

Comments
 (0)