Skip to content

Commit

Permalink
snap: handle registration error and compile warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Feb 23, 2009
1 parent 01af4a0 commit 0117cfa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/802/psnap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0117cfa

Please sign in to comment.