提交 30abc929 编写于 作者: V Vincent Mailhol 提交者: Marc Kleine-Budde

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.frSigned-off-by: NVincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
上级 94737ef5
......@@ -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)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册