From 8d5cf596d10d740b69b5f4bbdb54b85abf75810d Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 14 Dec 2006 15:50:01 -0800 Subject: [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 Signed-off-by: David S. Miller --- include/net/ax25.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/net') 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)); -- cgit v1.2.3