Commit b10cec8a4e8167075b9e1ff3f05419769e7f381a

Authored by Dennis Aberilla
Committed by David S. Miller
1 parent 48bdf072c3

drivers/net: ks8842 Fix crash on received packet when in PIO mode.

This patch fixes a driver crash during packet reception due to not enough
bytes allocated in the skb. Since the loop reads out 4 bytes at a time, we
need to allow for up to 3 bytes of slack space.

Signed-off-by: Dennis Aberilla <denzzzhome@yahoo.com>
Signed-off-by: David S. Miller <davem@zippy.davemloft.net>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/net/ks8842.c
... ... @@ -662,7 +662,7 @@
662 662  
663 663 /* check the status */
664 664 if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) {
665   - struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len);
  665 + struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len + 3);
666 666  
667 667 if (skb) {
668 668