summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Aberilla <dennis.aberilla@mimomax.com>2011-05-29 11:46:54 +0000
committerDavid S. Miller <davem@zippy.davemloft.net>2011-05-31 15:14:31 -0700
commitb10cec8a4e8167075b9e1ff3f05419769e7f381a (patch)
tree78f82ee427a29c9b3afcd4f06968495cb757b5bf
parent48bdf072c3f1f8f739f76d19c74f4c79605cac46 (diff)
downloadop-kernel-dev-b10cec8a4e8167075b9e1ff3f05419769e7f381a.zip
op-kernel-dev-b10cec8a4e8167075b9e1ff3f05419769e7f381a.tar.gz
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>
-rw-r--r--drivers/net/ks8842.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
index f0d8346..9bd0f55 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 + 3);
if (skb) {
OpenPOWER on IntegriCloud