diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2006-12-14 15:50:01 -0800 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-17 21:59:08 -0800 |
commit | 8d5cf596d10d740b69b5f4bbdb54b85abf75810d (patch) | |
tree | f0fd6a296f1b90d5fb1898ce1932c6ec5d245465 /include/net | |
parent | c9266b99e2def0a456766220df09713f8e765891 (diff) | |
download | linux-8d5cf596d10d740b69b5f4bbdb54b85abf75810d.tar.gz linux-8d5cf596d10d740b69b5f4bbdb54b85abf75810d.tar.bz2 linux-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 'include/net')
-rw-r--r-- | include/net/ax25.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/net/ax25.h b/include/net/ax25.h index ced202f0729b..51060ef74590 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -333,7 +333,14 @@ extern void ax25_ds_t3timer_expiry(ax25_cb *); extern void ax25_ds_idletimer_expiry(ax25_cb *); /* ax25_iface.c */ -extern int __must_check ax25_protocol_register(unsigned int, int (*)(struct sk_buff *, ax25_cb *)); + +struct ax25_protocol { + struct ax25_protocol *next; + unsigned int pid; + int (*func)(struct sk_buff *, ax25_cb *); +}; + +extern void ax25_register_pid(struct ax25_protocol *ap); extern void ax25_protocol_release(unsigned int); extern int __must_check ax25_linkfail_register(void (*)(ax25_cb *, int)); extern void ax25_linkfail_release(void (*)(ax25_cb *, int)); |