Message ID | 20190227145900.28808-1-yuehaibing@huawei.com |
---|---|
State | Changes Requested |
Delegated to: | David Miller |
Headers | show |
Series | appletalk: Fix use-after-free in atalk_proc_exit | expand |
From: Yue Haibing <yuehaibing@huawei.com> Date: Wed, 27 Feb 2019 22:59:00 +0800 > @@ -1925,7 +1925,10 @@ static int __init atalk_init(void) > > register_netdevice_notifier(&ddp_notifier); > aarp_proto_init(); > - atalk_proc_init(); > + rc = atalk_proc_init(); > + if (rc) > + goto out; > + > atalk_register_sysctl(); > out: This leaves the netdevice notifier registered etc. You need to add a proper error cleanup code path.
On 2019/2/28 2:14, David Miller wrote: > From: Yue Haibing <yuehaibing@huawei.com> > Date: Wed, 27 Feb 2019 22:59:00 +0800 > >> @@ -1925,7 +1925,10 @@ static int __init atalk_init(void) >> >> register_netdevice_notifier(&ddp_notifier); >> aarp_proto_init(); >> - atalk_proc_init(); >> + rc = atalk_proc_init(); >> + if (rc) >> + goto out; >> + >> atalk_register_sysctl(); >> out: > > This leaves the netdevice notifier registered etc. You need to add a proper > error cleanup code path. Oh, yes, I will do it. Thanks! > > . >
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 9b6bc5a..75075fe 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -1925,7 +1925,10 @@ static int __init atalk_init(void) register_netdevice_notifier(&ddp_notifier); aarp_proto_init(); - atalk_proc_init(); + rc = atalk_proc_init(); + if (rc) + goto out; + atalk_register_sysctl(); out: return rc;