/* * NET3: Support for 802.2 demultiplexing off Ethernet * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * Demultiplex 802.2 encoded protocols. We match the entry by the * SSAP/DSAP pair and then deliver to the registered datalink that * matches. The control byte is ignored and handling of such items * is up to the routine passed the frame. * * Unlike the 802.3 datalink we have a list of 802.2 entries as * there are multiple protocols to demux. The list is currently * short (3 or 4 entries at most). The current demux assumes this. */ #include #include #include #include #include #include #include #include #include #include static int p8022_request(struct datalink_proto *dl, struct sk_buff *skb, unsigned char *dest) { llc_build_and_send_ui_pkt(dl->sap, skb, dest, dl->sap->laddr.lsap); return 0; } struct datalink_proto *register_8022_client(unsigned char type, int (*func)(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)) { struct datalink_proto *proto; proto = kmalloc(sizeof(*proto), GFP_ATOMIC); if (proto) { proto->type[0] = type; proto->header_length = 3; proto->request = p8022_request; proto->sap = llc_sap_open(type, func); if (!proto->sap) { kfree(proto); proto = NULL; } } return proto; } void unregister_8022_client(struct datalink_proto *proto) { llc_sap_put(proto->sap); kfree(proto); } EXPORT_SYMBOL(register_8022_client); EXPORT_SYMBOL(unregister_8022_client); MODULE_LICENSE("GPL"); inux/net-next.git/commit/sound/isa/opti9xx?id=c73e44269369e936165f0f9b61f1f09a11dae01c'>commitdiff
diff options
context:
space:
mode:
authorVincent <vincent.stehle@laposte.net>2017-01-30 15:06:43 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-31 13:07:40 -0500
commitc73e44269369e936165f0f9b61f1f09a11dae01c (patch)
treee2188e900ba06302f8ed2746cb07edd3efbc5c35 /sound/isa/opti9xx
parent040587af31228d82c52267f717c9fcdb65f36335 (diff)
net: thunderx: avoid dereferencing xcv when NULL
This fixes the following smatch and coccinelle warnings: drivers/net/ethernet/cavium/thunder/thunder_xcv.c:119 xcv_setup_link() error: we previously assumed 'xcv' could be null (see line 118) [smatch] drivers/net/ethernet/cavium/thunder/thunder_xcv.c:119:16-20: ERROR: xcv is NULL but dereferenced. [coccinelle] Fixes: 6465859aba1e66a5 ("net: thunderx: Add RGMII interface type support") Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net> Cc: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'sound/isa/opti9xx')