]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: broadcom: bcm4908_enet: fix received skb length
authorRafał Miłecki <rafal@milecki.pl>
Thu, 11 Feb 2021 12:12:38 +0000 (13:12 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Feb 2021 23:04:17 +0000 (15:04 -0800)
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>
drivers/net/ethernet/broadcom/bcm4908_enet.c

index 47c1b7d827c5b3ec4a85ee40422a6b6388f0ce87..2e825db3b2f14769513409c19d4a62b3ebd6d49e 100644 (file)
@@ -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);