Skip to content

Commit

Permalink
net: broadcom: bcm4908_enet: fix received skb length
Browse files Browse the repository at this point in the history
Use ETH_FCS_LEN instead of magic value and drop incorrect + 2

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rafał Miłecki authored and David S. Miller committed Feb 11, 2021
1 parent e394881 commit 195e2d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bcm4908_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ static int bcm4908_enet_poll(struct napi_struct *napi, int weight)

dma_unmap_single(dev, slot.dma_addr, slot.len, DMA_FROM_DEVICE);

skb_put(slot.skb, len - 4 + 2);
skb_put(slot.skb, len - ETH_FCS_LEN);
slot.skb->protocol = eth_type_trans(slot.skb, enet->netdev);
netif_receive_skb(slot.skb);

Expand Down

0 comments on commit 195e2d9

Please sign in to comment.