提交 b10cec8a 编写于 作者: D Dennis Aberilla 提交者: David S. Miller

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: NDennis Aberilla <denzzzhome@yahoo.com>
Signed-off-by: NDavid S. Miller <davem@zippy.davemloft.net>
上级 48bdf072
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册