Skip to content

Commit

Permalink
drivers/net: ks8842 Fix crash on received packet when in PIO mode.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dennis Aberilla authored and David S. Miller committed May 31, 2011
1 parent 48bdf07 commit b10cec8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ks8842.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ static void ks8842_rx_frame(struct net_device *netdev,

/* check the status */
if ((status & RXSR_VALID) && !(status & RXSR_ERROR)) {
struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len);
struct sk_buff *skb = netdev_alloc_skb_ip_align(netdev, len + 3);

if (skb) {

Expand Down

0 comments on commit b10cec8

Please sign in to comment.