Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dennis Aberilla and committed by
David S. Miller
b10cec8a 48bdf072

+1 -1
+1 -1
drivers/net/ks8842.c
··· 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