summaryrefslogtreecommitdiff
path: root/net/netrom
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2006-12-14 15:50:01 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-17 21:59:08 -0800
commit8d5cf596d10d740b69b5f4bbdb54b85abf75810d (patch)
treef0fd6a296f1b90d5fb1898ce1932c6ec5d245465 /net/netrom
parentc9266b99e2def0a456766220df09713f8e765891 (diff)
downloadlinux-3.10-8d5cf596d10d740b69b5f4bbdb54b85abf75810d.tar.gz
linux-3.10-8d5cf596d10d740b69b5f4bbdb54b85abf75810d.tar.bz2
linux-3.10-8d5cf596d10d740b69b5f4bbdb54b85abf75810d.zip
[AX.25]: Fix unchecked ax25_protocol_register uses.
Replace ax25_protocol_register by ax25_register_pid which assumes the caller has done the memory allocation. This allows replacing the kmalloc allocations entirely by static allocations. 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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 1d50f801f18..f4675bf3976 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -1377,6 +1377,11 @@ static struct notifier_block nr_dev_notifier = {
static struct net_device **dev_nr;
+static struct ax25_protocol nr_pid = {
+ .pid = AX25_P_NETROM,
+ .func = nr_route_frame
+};
+
static int __init nr_proto_init(void)
{
int i;
@@ -1424,7 +1429,7 @@ static int __init nr_proto_init(void)
register_netdevice_notifier(&nr_dev_notifier);
- ax25_protocol_register(AX25_P_NETROM, nr_route_frame);
+ ax25_register_pid(&nr_pid);
ax25_linkfail_register(nr_link_failed);
#ifdef CONFIG_SYSCTL