Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa6ca0ec authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller
Browse files

net: systemport: Be drop monitor friendly while re-allocating headroom



During bcm_sysport_insert_tsb() make sure we differentiate a SKB
headroom re-allocation failure from the normal swap and replace path.

Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b5061778
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1230,12 +1230,13 @@ static struct sk_buff *bcm_sysport_insert_tsb(struct sk_buff *skb,
	/* Re-allocate SKB if needed */
	/* Re-allocate SKB if needed */
	if (unlikely(skb_headroom(skb) < sizeof(*tsb))) {
	if (unlikely(skb_headroom(skb) < sizeof(*tsb))) {
		nskb = skb_realloc_headroom(skb, sizeof(*tsb));
		nskb = skb_realloc_headroom(skb, sizeof(*tsb));
		dev_kfree_skb(skb);
		if (!nskb) {
		if (!nskb) {
			dev_kfree_skb_any(skb);
			dev->stats.tx_errors++;
			dev->stats.tx_errors++;
			dev->stats.tx_dropped++;
			dev->stats.tx_dropped++;
			return NULL;
			return NULL;
		}
		}
		dev_consume_skb_any(skb);
		skb = nskb;
		skb = nskb;
	}
	}