summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/allwinner/sun4i-emac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/allwinner/sun4i-emac.c')
-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)
}
/* Move data from EMAC */
- skb = dev_alloc_skb(rxlen + 4);
- if (good_packet && skb) {
+ if (good_packet) {
+ skb = netdev_alloc_skb(dev, rxlen + 4);
+ if (!skb)
+ continue;
skb_reserve(skb, 2);
rdptr = (u8 *) skb_put(skb, rxlen - 4);
OpenPOWER on IntegriCloud