aboutsummaryrefslogtreecommitdiffstats
path: root/net/rose
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2006-12-14 18:51:23 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-18 00:59:11 -0500
commita4282717c102aef2bfab1d947c392de4d8abc0ec (patch)
treeef178b6eea8cd9a8790ae58a6c19ff2aa877bcc1 /net/rose
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/rose')
-rw-r--r--net/rose/af_rose.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index 09f8a06bf806..9e279464c9d1 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -1487,6 +1487,10 @@ static struct ax25_protocol rose_pid = {
1487 .func = rose_route_frame 1487 .func = rose_route_frame
1488}; 1488};
1489 1489
1490static struct ax25_linkfail rose_linkfail_notifier = {
1491 .func = rose_link_failed
1492};
1493
1490static int __init rose_proto_init(void) 1494static int __init rose_proto_init(void)
1491{ 1495{
1492 int i; 1496 int i;
@@ -1537,7 +1541,7 @@ static int __init rose_proto_init(void)
1537 register_netdevice_notifier(&rose_dev_notifier); 1541 register_netdevice_notifier(&rose_dev_notifier);
1538 1542
1539 ax25_register_pid(&rose_pid); 1543 ax25_register_pid(&rose_pid);
1540 ax25_linkfail_register(rose_link_failed); 1544 ax25_linkfail_register(&rose_linkfail_notifier);
1541 1545
1542#ifdef CONFIG_SYSCTL 1546#ifdef CONFIG_SYSCTL
1543 rose_register_sysctl(); 1547 rose_register_sysctl();
@@ -1585,7 +1589,7 @@ static void __exit rose_exit(void)
1585 rose_rt_free(); 1589 rose_rt_free();
1586 1590
1587 ax25_protocol_release(AX25_P_ROSE); 1591 ax25_protocol_release(AX25_P_ROSE);
1588 ax25_linkfail_release(rose_link_failed); 1592 ax25_linkfail_release(&rose_linkfail_notifier);
1589 1593
1590 if (ax25cmp(&rose_callsign, &null_ax25_address) != 0) 1594 if (ax25cmp(&rose_callsign, &null_ax25_address) != 0)
1591 ax25_listen_release(&rose_callsign, NULL); 1595 ax25_listen_release(&rose_callsign, NULL);