From: Sowmini Varadhan Date: Thu, 1 Dec 2016 12:44:43 +0000 (-0800) Subject: RDS: TCP: unregister_netdevice_notifier() in error path of rds_tcp_init_net X-Git-Tag: v4.9.8~873^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=721c7443dcb26bf8c0b4ad317a36c7dfa140f1e4;p=platform%2Fkernel%2Flinux-rpi3.git RDS: TCP: unregister_netdevice_notifier() in error path of rds_tcp_init_net If some error is encountered in rds_tcp_init_net, make sure to unregister_netdevice_notifier(), else we could trigger a panic later on, when the modprobe from a netns fails. Signed-off-by: Sowmini Varadhan Acked-by: Santosh Shilimkar Signed-off-by: David S. Miller --- diff --git a/net/rds/tcp.c b/net/rds/tcp.c index fcddacc..20e2923 100644 --- a/net/rds/tcp.c +++ b/net/rds/tcp.c @@ -659,6 +659,8 @@ out_recv: out_pernet: unregister_pernet_subsys(&rds_tcp_net_ops); out_slab: + if (unregister_netdevice_notifier(&rds_tcp_dev_notifier)) + pr_warn("could not unregister rds_tcp_dev_notifier\n"); kmem_cache_destroy(rds_tcp_conn_slab); out: return ret;