aboutsummaryrefslogtreecommitdiffstats
path: root/net/rose
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2006-12-14 18:50:01 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-18 00:59:08 -0500
commit8d5cf596d10d740b69b5f4bbdb54b85abf75810d (patch)
treef0fd6a296f1b90d5fb1898ce1932c6ec5d245465 /net/rose
parentc9266b99e2def0a456766220df09713f8e765891 (diff)
[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/rose')
-rw-r--r--net/rose/af_rose.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 08a542855654..1605069e5db1 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -1481,6 +1481,11 @@ static struct notifier_block rose_dev_notifier = {
1481 1481
1482static struct net_device **dev_rose; 1482static struct net_device **dev_rose;
1483 1483
1484static struct ax25_protocol rose_pid = {
1485 .pid = AX25_P_ROSE,
1486 .func = rose_route_frame
1487};
1488
1484static int __init rose_proto_init(void) 1489static int __init rose_proto_init(void)
1485{ 1490{
1486 int i; 1491 int i;
@@ -1530,7 +1535,7 @@ static int __init rose_proto_init(void)
1530 sock_register(&rose_family_ops); 1535 sock_register(&rose_family_ops);
1531 register_netdevice_notifier(&rose_dev_notifier); 1536 register_netdevice_notifier(&rose_dev_notifier);
1532 1537
1533 ax25_protocol_register(AX25_P_ROSE, rose_route_frame); 1538 ax25_register_pid(&rose_pid);
1534 ax25_linkfail_register(rose_link_failed); 1539 ax25_linkfail_register(rose_link_failed);
1535 1540
1536#ifdef CONFIG_SYSCTL 1541#ifdef CONFIG_SYSCTL