]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
net: systemport: Be drop monitor friendly while re-allocating headroom
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 27 Sep 2018 22:36:13 +0000 (15:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Oct 2018 06:11:52 +0000 (23:11 -0700)
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: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcmsysport.c

index 977d9dec2fb061c7482783992fae8d2186caad7c..6c40cf6090ab313f205738880d66c135c604f1d8 100644 (file)
@@ -1230,12 +1230,13 @@ static struct sk_buff *bcm_sysport_insert_tsb(struct sk_buff *skb,
        /* Re-allocate SKB if needed */
        if (unlikely(skb_headroom(skb) < sizeof(*tsb))) {
                nskb = skb_realloc_headroom(skb, sizeof(*tsb));
-               dev_kfree_skb(skb);
                if (!nskb) {
+                       dev_kfree_skb_any(skb);
                        dev->stats.tx_errors++;
                        dev->stats.tx_dropped++;
                        return NULL;
                }
+               dev_consume_skb_any(skb);
                skb = nskb;
        }