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

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

From: Francois Romieu <romieu@fr.zoreil.com>
Date: 2013-07-26 21:24:13

Neil Horman [off-list ref] :
On Fri, Jul 26, 2013 at 10:06:30PM +0200, Francois Romieu wrote:
quoted
Neil Horman [off-list ref] :
[...]
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.

[...]
Thoughts?
Nevermind. cp_start_xmit is a piece of it and it isn't your work to
turn it into something sensible.

-- 
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