aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/allwinner/sun4i-emac.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index d81e7167a8b5..29b9f082475d 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -633,8 +633,10 @@ static void emac_rx(struct net_device *dev)
633 } 633 }
634 634
635 /* Move data from EMAC */ 635 /* Move data from EMAC */
636 skb = dev_alloc_skb(rxlen + 4); 636 if (good_packet) {
637 if (good_packet && skb) { 637 skb = netdev_alloc_skb(dev, rxlen + 4);
638 if (!skb)
639 continue;
638 skb_reserve(skb, 2); 640 skb_reserve(skb, 2);
639 rdptr = (u8 *) skb_put(skb, rxlen - 4); 641 rdptr = (u8 *) skb_put(skb, rxlen - 4);
640 642