Commit 701a0fd5 authored by wangweidong's avatar wangweidong Committed by David S. Miller

hip04_eth: fix missing error handle for build_skb failed

when build_skb failed, we should goto refill the buffer.
Signed-off-by: default avatarWeidong Wang <wangweidong1@huawei.com>
Acked-by: default avatarDing Tainhong <dingtianhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1adbfc43
...@@ -500,8 +500,10 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget) ...@@ -500,8 +500,10 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)
while (cnt && !last) { while (cnt && !last) {
buf = priv->rx_buf[priv->rx_head]; buf = priv->rx_buf[priv->rx_head];
skb = build_skb(buf, priv->rx_buf_size); skb = build_skb(buf, priv->rx_buf_size);
if (unlikely(!skb)) if (unlikely(!skb)) {
net_dbg_ratelimited("build_skb failed\n"); net_dbg_ratelimited("build_skb failed\n");
goto refill;
}
dma_unmap_single(&ndev->dev, priv->rx_phys[priv->rx_head], dma_unmap_single(&ndev->dev, priv->rx_phys[priv->rx_head],
RX_BUF_SIZE, DMA_FROM_DEVICE); RX_BUF_SIZE, DMA_FROM_DEVICE);
...@@ -528,6 +530,7 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget) ...@@ -528,6 +530,7 @@ static int hip04_rx_poll(struct napi_struct *napi, int budget)
rx++; rx++;
} }
refill:
buf = netdev_alloc_frag(priv->rx_buf_size); buf = netdev_alloc_frag(priv->rx_buf_size);
if (!buf) if (!buf)
goto done; goto done;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment