Thread (14 messages) 14 messages, 3 authors, 2013-08-01

Re: [net PATCH v2] 8139cp: Add dma_mapping_error checking

From: Neil Horman <nhorman@tuxdriver.com>
Date: 2013-07-28 10:41:05

On Fri, Jul 26, 2013 at 11:24:03PM +0200, Francois Romieu wrote:
Neil Horman [off-list ref] :
quoted
On Fri, Jul 26, 2013 at 10:06:30PM +0200, Francois Romieu wrote:
quoted
Neil Horman [off-list ref] :
[...]
quoted
quoted
quoted
@@ -533,6 +533,11 @@ rx_status_loop:
 
 		mapping = dma_map_single(&cp->pdev->dev, new_skb->data, buflen,
 					 PCI_DMA_FROMDEVICE);
+		if (dma_mapping_error(&cp->pdev->dev, mapping)) {
+			kfree_skb(skb);
			dev->stats.rx_dropped++;

Sorry, I did not notice that skb contained newly received data :o/
Yeah, this isn't needed.  The skb being mapped in is newly allocated, and
contains no data.  We haven't dropped anything here, so theres no need for the
stats bump.
Huh ?

[...error path...]
		kfree(skb);
[...normal path...]
	cp_rx_skb(cp, skb, desc);

Afaiks it's the same skb. We drop data and a stats bump is needed.

[...]
quoted
Thoughts?
Nevermind. cp_start_xmit is a piece of it and it isn't your work to
turn it into something sensible.
So you agree with the patch as it stands?
Neil
-- 
Ueimor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help