lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 26 Feb 2009 11:25:49 +0100
From:	Rini van Zetten <rini@...oo.nl>
To:	David Miller <davem@...emloft.net>
Cc:	Linuxppc-dev@...abs.org, afleming@...escale.com,
	netdev@...r.kernel.org
Subject: [PATCH v2 net] gianfar : Do right check on num_txbdfree

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@...oo.nl>
---
  drivers/net/gianfar.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 7ef1ffd..2dc3bd3 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1284,9 +1284,8 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
      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++;
          spin_unlock_irqrestore(&priv->txlock, flags);
-- 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ