mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
[AX.25]: Fix unchecked ax25_linkfail_register uses
ax25_linkfail_register uses kmalloc and the callers were ignoring the error value. Rewrite to let the caller deal with the allocation. This allows the use of static allocation of kmalloc use entirely. Signed-off-by: Ralf Baechle <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
58bc574715
commit
a4282717c1
4 changed files with 29 additions and 52 deletions
|
|
@ -1382,6 +1382,10 @@ static struct ax25_protocol nr_pid = {
|
|||
.func = nr_route_frame
|
||||
};
|
||||
|
||||
static struct ax25_linkfail nr_linkfail_notifier = {
|
||||
.func = nr_link_failed,
|
||||
};
|
||||
|
||||
static int __init nr_proto_init(void)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -1430,7 +1434,7 @@ static int __init nr_proto_init(void)
|
|||
register_netdevice_notifier(&nr_dev_notifier);
|
||||
|
||||
ax25_register_pid(&nr_pid);
|
||||
ax25_linkfail_register(nr_link_failed);
|
||||
ax25_linkfail_register(&nr_linkfail_notifier);
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
nr_register_sysctl();
|
||||
|
|
@ -1479,7 +1483,7 @@ static void __exit nr_exit(void)
|
|||
nr_unregister_sysctl();
|
||||
#endif
|
||||
|
||||
ax25_linkfail_release(nr_link_failed);
|
||||
ax25_linkfail_release(&nr_linkfail_notifier);
|
||||
ax25_protocol_release(AX25_P_NETROM);
|
||||
|
||||
unregister_netdevice_notifier(&nr_dev_notifier);
|
||||
|
|
|
|||
Loading…
Reference in a new issue