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

From: Dennis Aberilla
Date: Wed May 18 2011 - 17:57:03 EST



This patch fixes a kernel crash during packet reception due to not enough allocated bytes for the skb. This applies to the driver when running in PIO mode in an ISA bus setup.

Signed-off-by: Dennis Aberilla <denzzzhome@xxxxxxxxx>


---
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
index f0d8346..9069aee 100644
--- a/drivers/net/ks8842.c
+++ b/drivers/net/ks8842.c
@@ -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 + 2);

if (skb) {



--

|Dennis
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/