Skip to content

Commit

Permalink
niu: Fix to check for dma mapping errors.
Browse files Browse the repository at this point in the history
Fix Neptune ethernet driver to check dma mapping error after map_page()
interface returns.

Signed-off-by: Shuah Khan <shuah.khan@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Shuah Khan authored and David S. Miller committed Jul 23, 2012
1 parent 8188104 commit ec2deec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ethernet/sun/niu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ec2deec

Please sign in to comment.