aboutsummaryrefslogtreecommitdiffstats
path: root/net/802/psnap.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-02-22 03:03:19 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-22 22:54:47 -0500
commit0117cfabe3ba9b430c6ff6eecd4fdc569977f24f (patch)
tree9a312a491177562110bc91279809746883624bcc /net/802/psnap.c
parent01af4a0e3cce86212f6bf54ebe8f84d7219c862a (diff)
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 <shemminger@vyatta.com> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/802/psnap.c')
-rw-r--r--net/802/psnap.c7
1 files changed, 4 insertions, 3 deletions
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,
95EXPORT_SYMBOL(register_snap_client); 95EXPORT_SYMBOL(register_snap_client);
96EXPORT_SYMBOL(unregister_snap_client); 96EXPORT_SYMBOL(unregister_snap_client);
97 97
98static char snap_err_msg[] __initdata = 98static const char snap_err_msg[] __initconst =
99 KERN_CRIT "SNAP - unable to register with 802.2\n"; 99 KERN_CRIT "SNAP - unable to register with 802.2\n";
100 100
101static int __init snap_init(void) 101static int __init snap_init(void)
102{ 102{
103 snap_sap = llc_sap_open(0xAA, snap_rcv); 103 snap_sap = llc_sap_open(0xAA, snap_rcv);
104 104 if (!snap_sap) {
105 if (!snap_sap)
106 printk(snap_err_msg); 105 printk(snap_err_msg);
106 return -EBUSY;
107 }
107 108
108 return 0; 109 return 0;
109} 110}