From 0117cfabe3ba9b430c6ff6eecd4fdc569977f24f Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sun, 22 Feb 2009 00:03:19 -0800 Subject: snap: handle registration error and compile warning If this module can't load, it is almost certainly because something else is already bound to that SAP. So in that case, return the same error code as other SAP usage, and fail the module load. Also fixes a compiler warning about printk of non const. Signed-off-by: Stephen Hemminger Acked-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller --- net/802/psnap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'net/802') diff --git a/net/802/psnap.c b/net/802/psnap.c index 6ed711748f26..bdbffa3cb043 100644 --- a/net/802/psnap.c +++ b/net/802/psnap.c @@ -95,15 +95,16 @@ static int snap_request(struct datalink_proto *dl, EXPORT_SYMBOL(register_snap_client); EXPORT_SYMBOL(unregister_snap_client); -static char snap_err_msg[] __initdata = +static const char snap_err_msg[] __initconst = KERN_CRIT "SNAP - unable to register with 802.2\n"; static int __init snap_init(void) { snap_sap = llc_sap_open(0xAA, snap_rcv); - - if (!snap_sap) + if (!snap_sap) { printk(snap_err_msg); + return -EBUSY; + } return 0; } -- cgit v1.2.1