Thread (2 messages) flat view 2 messages, 2 authors, 2015-06-08

Re: [PATCH] net: moxa: fix TX overrun memory leak

From: David Miller <davem@davemloft.net>
Date: 2015-06-08 02:22:10
Also in: linux-arm-kernel, lkml

From: Jonas Jensen <redacted>
Date: Fri,  5 Jun 2015 15:46:18 +0200
 	desc = priv->tx_desc_base + (TX_REG_DESC_SIZE * tx_head);
 
-	spin_lock_irq(&priv->txlock);
+	if (CIRC_SPACE(tx_head, tx_tail, TX_DESC_NUM) == 0) {
+		priv->stats.tx_dropped++;
+		goto out_unlock;
+	}
You can't do this.

Whatever code creates this condition _must_ stop the TX queue
so that the core netdevice transmit layer does not call your
transmit method.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help