Merge "usb: gadget: u_ether: Add skb check in eth_start_xmit"

This commit is contained in:
qctecmdr 2020-08-26 17:22:49 -07:00 • committed by Gerrit - the friendly Code Review server
commit c786d5a718

View file

@ -490,7 +490,7 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
}
spin_unlock_irqrestore(&dev->lock, flags);
if (!in) {
if (skb && !in) {
dev_kfree_skb_any(skb);
return NETDEV_TX_OK;
}
@ -547,15 +547,15 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
if (dev->port_usb)
skb = dev->wrap(dev->port_usb, skb);
spin_unlock_irqrestore(&dev->lock, flags);
if (!skb) {
/* Multi frame CDC protocols may store the frame for
* later which is not a dropped frame.
*/
if (dev->port_usb &&
dev->port_usb->supports_multi_frame)
goto multiframe;
goto drop;
}
}
if (!skb) {
/* Multi frame CDC protocols may store the frame for
* later which is not a dropped frame.
*/
if (dev->port_usb &&
dev->port_usb->supports_multi_frame)
goto multiframe;
goto drop;
}
length = skb->len;