summaryrefslogtreecommitdiff
path: root/drivers/net/can/bfin_can.c
diff options
context:
space:
mode:
authorOliver Hartkopp <oliver@hartkopp.net>2010-01-12 13:00:46 +0300
committerDavid S. Miller <davem@davemloft.net>2010-01-12 13:00:46 +0300
commit3ccd4c6167d3b39d52631767ebbf8b5677c5855d (patch)
treebfcb801edebd00e8b30e897038bad7fee39625cc /drivers/net/can/bfin_can.c
parentd218d11133d888f9745802146a50255a4781d37a (diff)
downloadlinux-3ccd4c6167d3b39d52631767ebbf8b5677c5855d.tar.xz
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/bfin_can.c')
-rw-r--r--drivers/net/can/bfin_can.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index 0ec1524523cc..7e1926e79e98 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -318,6 +318,9 @@ static int bfin_can_start_xmit(struct sk_buff *skb, struct net_device *dev)
u16 val;
int i;
+ if (can_dropped_invalid_skb(dev, skb))
+ return NETDEV_TX_OK;
+
netif_stop_queue(dev);
/* fill id */