diff options
author | Eric Dumazet <edumazet@google.com> | 2020-05-07 19:32:21 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-08 04:11:07 +0300 |
commit | f78ed2204db9fc35b545d693865bddbe0149aa1f (patch) | |
tree | 547a43f4bee21b4880397429cca2a02ab85f397c /net/8021q/vlan_dev.c | |
parent | 1ddabdfaf70c202b88925edd74c66f4707dbd92e (diff) | |
download | linux-f78ed2204db9fc35b545d693865bddbe0149aa1f.tar.xz |
netpoll: accept NULL np argument in netpoll_send_skb()
netpoll_send_skb() callers seem to leak skb if
the np pointer is NULL. While this should not happen, we
can make the code more robust.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan_dev.c')
-rw-r--r-- | net/8021q/vlan_dev.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 319220b2341d..f00bb57f0f60 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -88,12 +88,11 @@ static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev, static inline netdev_tx_t vlan_netpoll_send_skb(struct vlan_dev_priv *vlan, struct sk_buff *skb) { #ifdef CONFIG_NET_POLL_CONTROLLER - if (vlan->netpoll) - netpoll_send_skb(vlan->netpoll, skb); + return netpoll_send_skb(vlan->netpoll, skb); #else BUG(); -#endif return NETDEV_TX_OK; +#endif } static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb, |