Skip to content

Commit

Permalink
net: ethernet: cadence: fix socket buffer corruption problem
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tristram Ha authored and David S. Miller committed Oct 25, 2018
1 parent 4f3ebb0 commit 899ecae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/cadence/macb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 899ecae

Please sign in to comment.