* [PATCH RFT RESEND] net: Fix Neptune ethernet driver to check dma mapping error
@ 2012-07-20 21:50 Shuah Khan
2012-07-23 6:34 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Shuah Khan @ 2012-07-20 21:50 UTC (permalink / raw)
To: davem, mcarlson, bhutchings, eric.dumazet, mchan
Cc: netdev, LKML, shuahkhan, stable
Fix Neptune ethernet driver to check dma mapping error after map_page()
interface returns.
Signed-off-by: Shuah Khan <shuah.khan@hp.com>
---
drivers/net/ethernet/sun/niu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index 8c726b7..60d5c03 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -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)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-23 6:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-20 21:50 [PATCH RFT RESEND] net: Fix Neptune ethernet driver to check dma mapping error Shuah Khan
2012-07-23 6:34 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).