diff options
author | Oliver Hartkopp <oliver@hartkopp.net> | 2010-01-12 02:00:46 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-12 02:00:46 -0800 |
commit | 3ccd4c6167d3b39d52631767ebbf8b5677c5855d (patch) | |
tree | bfcb801edebd00e8b30e897038bad7fee39625cc /drivers/net/can/usb | |
parent | d218d11133d888f9745802146a50255a4781d37a (diff) | |
download | kernel_samsung_crespo-3ccd4c6167d3b39d52631767ebbf8b5677c5855d.zip kernel_samsung_crespo-3ccd4c6167d3b39d52631767ebbf8b5677c5855d.tar.gz kernel_samsung_crespo-3ccd4c6167d3b39d52631767ebbf8b5677c5855d.tar.bz2 |
can: Unify droping of invalid tx skbs and netdev stats
To prevent the CAN drivers to operate on invalid socketbuffers the skbs are
now checked and silently dropped at the xmit-function consistently.
Also the netdev stats are consistently using the CAN data length code (dlc)
for [rx|tx]_bytes now.
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/can/usb')
-rw-r--r-- | drivers/net/can/usb/ems_usb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c index efbb05c..ddb17e2 100644 --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c @@ -767,6 +767,9 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne size_t size = CPC_HEADER_SIZE + CPC_MSG_HEADER_LEN + sizeof(struct cpc_can_msg); + if (can_dropped_invalid_skb(netdev, skb)) + return NETDEV_TX_OK; + /* create a URB, and a buffer for it, and copy the data to the URB */ urb = usb_alloc_urb(0, GFP_ATOMIC); if (!urb) { |