Commit aca5f58f authored by David S. Miller's avatar David S. Miller

netpoll: Fix missing TXQ unlock and and OOPS.

The VLAN tag handling code in netpoll_send_skb_on_dev() has two problems.

1) It exits without unlocking the TXQ.

2) It then tries to queue a NULL skb to npinfo->txq.
Reported-by: default avatarAhmed Tamrawi <atamrawi@iastate.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 469bdcef
...@@ -386,8 +386,14 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, ...@@ -386,8 +386,14 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
!vlan_hw_offload_capable(netif_skb_features(skb), !vlan_hw_offload_capable(netif_skb_features(skb),
skb->vlan_proto)) { skb->vlan_proto)) {
skb = __vlan_put_tag(skb, skb->vlan_proto, vlan_tx_tag_get(skb)); skb = __vlan_put_tag(skb, skb->vlan_proto, vlan_tx_tag_get(skb));
if (unlikely(!skb)) if (unlikely(!skb)) {
break; /* This is actually a packet drop, but we
* don't want the code at the end of this
* function to try and re-queue a NULL skb.
*/
status = NETDEV_TX_OK;
goto unlock_txq;
}
skb->vlan_tci = 0; skb->vlan_tci = 0;
} }
...@@ -395,6 +401,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, ...@@ -395,6 +401,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
if (status == NETDEV_TX_OK) if (status == NETDEV_TX_OK)
txq_trans_update(txq); txq_trans_update(txq);
} }
unlock_txq:
__netif_tx_unlock(txq); __netif_tx_unlock(txq);
if (status == NETDEV_TX_OK) if (status == NETDEV_TX_OK)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment