OSDN Git Service

net: ethernet: cadence: fix socket buffer corruption problem
authorTristram Ha <Tristram.Ha@microchip.com>
Wed, 24 Oct 2018 21:51:23 +0000 (14:51 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Oct 2018 18:32:24 +0000 (11:32 -0700)
Socket buffer is not re-created when headroom is 2 and tailroom is 1.

Signed-off-by: Tristram Ha <Tristram.Ha@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c

index 8f5bf91..1d86b4d 100644 (file)
@@ -1684,7 +1684,7 @@ static int macb_pad_and_fcs(struct sk_buff **skb, struct net_device *ndev)
                        padlen = 0;
                /* No room for FCS, need to reallocate skb. */
                else
-                       padlen = ETH_FCS_LEN - tailroom;
+                       padlen = ETH_FCS_LEN;
        } else {
                /* Add room for FCS. */
                padlen += ETH_FCS_LEN;