summaryrefslogtreecommitdiff
path: root/net/netrom
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2006-12-14 15:51:23 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-17 21:59:11 -0800
commita4282717c102aef2bfab1d947c392de4d8abc0ec (patch)
treeef178b6eea8cd9a8790ae58a6c19ff2aa877bcc1 /net/netrom
parent58bc57471514be9206ebcda90b1076f6be41d1c7 (diff)
[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 <ralf@linux-mips.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netrom')
-rw-r--r--net/netrom/af_netrom.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index f4675bf3976c..43bbe2c9e49a 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -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);