net: bcmgenet: Add a check for oversized packets
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 27 Jan 2023 00:08:19 +0000 (16:08 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Jan 2023 07:23:16 +0000 (07:23 +0000)
commit5c0862c2c962052ed5055220a00ac1cefb92fbcd
treef7424bfea5f59cc9b8263984a3fe1121dd172de0
parent468ba54bd616db995514f9671ac116eb4b62e0ea
net: bcmgenet: Add a check for oversized packets

Occasionnaly we may get oversized packets from the hardware which
exceed the nomimal 2KiB buffer size we allocate SKBs with. Add an early
check which drops the packet to avoid invoking skb_over_panic() and move
on to processing the next packet.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c