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-next>] [day] [month] [year] [list]
Date:	Thu, 22 Aug 2013 18:40:36 +0800
From:	Fugang Duan <B38611@...escale.com>
To:	<b20596@...escale.com>, <b45643@...escale.com>,
	<davem@...emloft.net>
CC:	<netdev@...r.kernel.org>, <shawn.guo@...aro.org>,
	<bhutchings@...arflare.com>, <R49496@...escale.com>,
	<stephen@...workplumber.org>
Subject: [PATCH] net: fec: fix the error to get the previous BD entry

When the current BD is the first BD, the previous BD entry
must be the last BD, not "bdp - 1".

Add BD entry check to get the previous BD entry correctly.

Signed-off-by: Fugang Duan  <B38611@...escale.com>
---
 drivers/net/ethernet/freescale/fec_main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 4ea1555..4349a9e 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -380,7 +380,10 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 		}
 	}
 
-	bdp_pre = fec_enet_get_prevdesc(bdp, fep->bufdesc_ex);
+	if (bdp == fep->tx_bd_base)
+		bdp_pre = bdp + TX_RING_SIZE - 1;
+	else
+		bdp_pre = fec_enet_get_prevdesc(bdp, fep->bufdesc_ex);
 	if ((id_entry->driver_data & FEC_QUIRK_ERR006358) &&
 	    !(bdp_pre->cbd_sc & BD_ENET_TX_READY)) {
 		fep->delay_work.trig_tx = true;
-- 
1.7.1


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