summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwangweidong2016-01-13 04:11:09 +0100
committerDavid S. Miller2016-01-13 21:48:14 +0100
commit701a0fd5231866db08cebcd502894699f49cb960 (patch)
tree06318a9113f6145487379ba811e24e7b3f4501f1
parentMerge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge (diff)
downloadkernel-qcow2-linux-701a0fd5231866db08cebcd502894699f49cb960.tar.gz
kernel-qcow2-linux-701a0fd5231866db08cebcd502894699f49cb960.tar.xz
kernel-qcow2-linux-701a0fd5231866db08cebcd502894699f49cb960.zip
hip04_eth: fix missing error handle for build_skb failed
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>
-rw-r--r--drivers/net/ethernet/hisilicon/hip04_eth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index 253f8ed0537a..0c4afe95ef54 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -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;