Skip to content

Commit b10cec8

Browse files
Dennis AberillaDavid S. Miller
authored andcommitted
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>
1 parent 48bdf07 commit b10cec8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ks8842.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ static void ks8842_rx_frame(struct net_device *netdev,
662662

663663
/* check the status */
664664
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);
666666

667667
if (skb) {
668668

0 commit comments

Comments
 (0)