From: Doug Berger Date: Wed, 18 Dec 2019 00:51:14 +0000 (-0800) Subject: net: bcmgenet: Be drop monitor friendly while re-allocating headroom X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e3fa85883d1566d788960c0f31866a26c898c070;p=openwrt%2Fstaging%2Fblogic.git net: bcmgenet: Be drop monitor friendly while re-allocating headroom During bcmgenet_put_tx_csum() make sure we differentiate a SKB headroom re-allocation failure from the normal swap and replace path. Signed-off-by: Doug Berger Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 13e9154db253..e2bca19bf10b 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -1499,11 +1499,12 @@ static struct sk_buff *bcmgenet_put_tx_csum(struct net_device *dev, * enough headroom for us to insert 64B status block. */ new_skb = skb_realloc_headroom(skb, sizeof(*status)); - dev_kfree_skb(skb); if (!new_skb) { + dev_kfree_skb_any(skb); dev->stats.tx_dropped++; return NULL; } + dev_consume_skb_any(skb); skb = new_skb; }