summaryrefslogtreecommitdiff
path: root/drivers/net/can/slcan.c
diff options
context:
space:
mode:
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>2022-05-14 17:16:47 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2022-05-16 23:06:51 +0300
commit30abc929132929b52fa7203c35e60335c500bd17 (patch)
tree57452188bc6d36c4a21dada50da57706bcd1f9b7 /drivers/net/can/slcan.c
parent94737ef56b610d94a24fadfb8386fc17dbd79ddd (diff)
downloadlinux-30abc929132929b52fa7203c35e60335c500bd17.tar.xz
can: slcan: slc_xmit(): use can_dropped_invalid_skb() instead of manual check
slcan does a manual check in slc_xmit() to verify if the skb is valid. This check is incomplete, use instead can_dropped_invalid_skb(). Link: https://lore.kernel.org/all/20220514141650.1109542-2-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/slcan.c')
-rw-r--r--drivers/net/can/slcan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index ec294d0c5722..64a3aee8a7da 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -359,8 +359,8 @@ static netdev_tx_t slc_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct slcan *sl = netdev_priv(dev);
- if (skb->len != CAN_MTU)
- goto out;
+ if (can_dropped_invalid_skb(dev, skb))
+ return NETDEV_TX_OK;
spin_lock(&sl->lock);
if (!netif_running(dev)) {