提交 ec2deec1 编写于 作者: S Shuah Khan 提交者: David S. Miller

niu: Fix to check for dma mapping errors.

Fix Neptune ethernet driver to check dma mapping error after map_page()
interface returns.
Signed-off-by: NShuah Khan <shuah.khan@hp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 81881047
......@@ -3335,6 +3335,10 @@ static int niu_rbr_add_page(struct niu *np, struct rx_ring_info *rp,
addr = np->ops->map_page(np->device, page, 0,
PAGE_SIZE, DMA_FROM_DEVICE);
if (!addr) {
__free_page(page);
return -ENOMEM;
}
niu_hash_page(rp, page, addr);
if (rp->rbr_blocks_per_page > 1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册