This patch fixes a wrong check on num_txbdfree. It could lead to
num_txbdfree become nagative. Result was that the gianfar stops
sending data.
Changes from first version :
- removed a space between parens (David Millers comment)
- full email address in signed off line
Signed-off-by: Rini van Zetten <rini@arvoo.nl>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
spin_lock_irqsave(&priv->txlock, flags);
/* check if there is space to queue this packet */
- if (nr_frags > priv->num_txbdfree) {
+ if ((nr_frags+1) > priv->num_txbdfree) {
/* no space, stop the queue */
netif_stop_queue(dev);
dev->stats.tx_fifo_errors++;