diff options
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r-- | drivers/net/sky2.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index c7b4da1d717f..9b428e423c3d 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1694,6 +1694,9 @@ static struct sk_buff *sky2_receive(struct sky2_port *sky2, | |||
1694 | if (!(status & GMR_FS_RX_OK)) | 1694 | if (!(status & GMR_FS_RX_OK)) |
1695 | goto resubmit; | 1695 | goto resubmit; |
1696 | 1696 | ||
1697 | if ((status >> 16) != length || length > sky2->rx_bufsize) | ||
1698 | goto oversize; | ||
1699 | |||
1697 | if (length < copybreak) { | 1700 | if (length < copybreak) { |
1698 | skb = alloc_skb(length + 2, GFP_ATOMIC); | 1701 | skb = alloc_skb(length + 2, GFP_ATOMIC); |
1699 | if (!skb) | 1702 | if (!skb) |
@@ -1735,7 +1738,13 @@ resubmit: | |||
1735 | 1738 | ||
1736 | return skb; | 1739 | return skb; |
1737 | 1740 | ||
1741 | oversize: | ||
1742 | ++sky2->net_stats.rx_over_errors; | ||
1743 | goto resubmit; | ||
1744 | |||
1738 | error: | 1745 | error: |
1746 | ++sky2->net_stats.rx_errors; | ||
1747 | |||
1739 | if (netif_msg_rx_err(sky2)) | 1748 | if (netif_msg_rx_err(sky2)) |
1740 | printk(KERN_INFO PFX "%s: rx error, status 0x%x length %d\n", | 1749 | printk(KERN_INFO PFX "%s: rx error, status 0x%x length %d\n", |
1741 | sky2->netdev->name, status, length); | 1750 | sky2->netdev->name, status, length); |