aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fec.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/fec.c')
-rw-r--r--drivers/net/fec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 5ca2d6bcc23a..ba3eb54b63f5 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -598,13 +598,14 @@ fec_enet_rx(struct net_device *dev)
598 * include that when passing upstream as it messes up 598 * include that when passing upstream as it messes up
599 * bridging applications. 599 * bridging applications.
600 */ 600 */
601 skb = dev_alloc_skb(pkt_len - 4); 601 skb = dev_alloc_skb(pkt_len - 4 + NET_IP_ALIGN);
602 602
603 if (skb == NULL) { 603 if (unlikely(!skb)) {
604 printk("%s: Memory squeeze, dropping packet.\n", 604 printk("%s: Memory squeeze, dropping packet.\n",
605 dev->name); 605 dev->name);
606 dev->stats.rx_dropped++; 606 dev->stats.rx_dropped++;
607 } else { 607 } else {
608 skb_reserve(skb, NET_IP_ALIGN);
608 skb_put(skb, pkt_len - 4); /* Make room */ 609 skb_put(skb, pkt_len - 4); /* Make room */
609 skb_copy_to_linear_data(skb, data, pkt_len - 4); 610 skb_copy_to_linear_data(skb, data, pkt_len - 4);
610 skb->protocol = eth_type_trans(skb, dev); 611 skb->protocol = eth_type_trans(skb, dev);