]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
hip04_eth: fix missing error handle for build_skb failed
authorwangweidong <wangweidong1@huawei.com>
Wed, 13 Jan 2016 03:11:09 +0000 (11:11 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Jan 2016 20:48:14 +0000 (15:48 -0500)
when build_skb failed, we should goto refill the buffer.

Signed-off-by: Weidong Wang <wangweidong1@huawei.com>
Acked-by: Ding Tainhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hip04_eth.c

index 253f8ed0537a058778fd08b2c5a0747f53d7eca4..0c4afe95ef54aa80c94a0ea35bba5203f6cef675 100644 (file)
@@ -500,8 +500,10 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)
        while (cnt && !last) {
                buf = priv->rx_buf[priv->rx_head];
                skb = build_skb(buf, priv->rx_buf_size);
-               if (unlikely(!skb))
+               if (unlikely(!skb)) {
                        net_dbg_ratelimited("build_skb failed\n");
+                       goto refill;
+               }
 
                dma_unmap_single(&ndev->dev, priv->rx_phys[priv->rx_head],
                                 RX_BUF_SIZE, DMA_FROM_DEVICE);
@@ -528,6 +530,7 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)
                        rx++;
                }
 
+refill:
                buf = netdev_alloc_frag(priv->rx_buf_size);
                if (!buf)
                        goto done;