[PATCH RFT] net: Fix Neptune ethernet driver to check dma mapping error

Subsystems: networking drivers, the rest

STALE5142d

3 messages, 2 authors, 2012-07-20 · open the first message on its own page

[PATCH RFT] net: Fix Neptune ethernet driver to check dma mapping error

From: Shuah Khan <hidden>
Date: 2012-07-20 21:28:07

Request for testing, since I don't have the hardware to test.

--------------------------------------------------------------------

Fix Neptune ethernet driver to check dma mapping error after map_page()
interface returns.

Signed-off-by: Shuah Khan <redacted>
Cc: <redacted>
---
 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

Re: [PATCH RFT] net: Fix Neptune ethernet driver to check dma mapping error

From: David Miller <davem@davemloft.net>
Date: 2012-07-20 21:30:09

From: Shuah Khan <redacted>
Date: Fri, 20 Jul 2012 15:27:59 -0600
Request for testing, since I don't have the hardware to test.
This is not how you post a patch.
--------------------------------------------------------------------
When you put those "---..." there, GIT is going to eliminate everything
afterwards from the commit mesage when I apply this.  Yet afterwards
is what your commit message actually is.

You therefore should do things the other way around, provide the commit
message text, then the "---..." line, then your comments you don't want
in the final commit message.

Re: [PATCH RFT] net: Fix Neptune ethernet driver to check dma mapping error

From: Shuah Khan <hidden>
Date: 2012-07-20 21:36:41

On Fri, 2012-07-20 at 14:30 -0700, David Miller wrote:
From: Shuah Khan <redacted>
Date: Fri, 20 Jul 2012 15:27:59 -0600
quoted
Request for testing, since I don't have the hardware to test.
This is not how you post a patch.
quoted
--------------------------------------------------------------------
When you put those "---..." there, GIT is going to eliminate everything
afterwards from the commit mesage when I apply this.  Yet afterwards
is what your commit message actually is.

You therefore should do things the other way around, provide the commit
message text, then the "---..." line, then your comments you don't want
in the final commit message.
Thanks. I had it reversed in my head for some reason. Maybe not enough
coffee :) Will resend the patch now.

-- Shuah
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help