[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>
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 08a5428..1605069 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -1481,6 +1481,11 @@
static struct net_device **dev_rose;
+static struct ax25_protocol rose_pid = {
+ .pid = AX25_P_ROSE,
+ .func = rose_route_frame
+};
+
static int __init rose_proto_init(void)
{
int i;
@@ -1530,7 +1535,7 @@
sock_register(&rose_family_ops);
register_netdevice_notifier(&rose_dev_notifier);
- ax25_protocol_register(AX25_P_ROSE, rose_route_frame);
+ ax25_register_pid(&rose_pid);
ax25_linkfail_register(rose_link_failed);
#ifdef CONFIG_SYSCTL