summaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2020-05-07 09:32:21 -0700
committerDavid S. Miller <davem@davemloft.net>2020-05-07 18:11:07 -0700
commitf78ed2204db9fc35b545d693865bddbe0149aa1f (patch)
tree547a43f4bee21b4880397429cca2a02ab85f397c /net/dsa
parent1ddabdfaf70c202b88925edd74c66f4707dbd92e (diff)
downloadlinux-stable-f78ed2204db9fc35b545d693865bddbe0149aa1f.tar.gz
linux-stable-f78ed2204db9fc35b545d693865bddbe0149aa1f.tar.bz2
linux-stable-f78ed2204db9fc35b545d693865bddbe0149aa1f.zip
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/dsa')
-rw-r--r--net/dsa/slave.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index dfb4282fc339..61b0de52040a 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -445,12 +445,11 @@ static inline netdev_tx_t dsa_slave_netpoll_send_skb(struct net_device *dev,
#ifdef CONFIG_NET_POLL_CONTROLLER
struct dsa_slave_priv *p = netdev_priv(dev);
- if (p->netpoll)
- netpoll_send_skb(p->netpoll, skb);
+ return netpoll_send_skb(p->netpoll, skb);
#else
BUG();
-#endif
return NETDEV_TX_OK;
+#endif
}
static void dsa_skb_tx_timestamp(struct dsa_slave_priv *p,