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]
Message-ID: <1377837325-5232-1-git-send-email-B38611@freescale.com>
Date:	Fri, 30 Aug 2013 12:35:25 +0800
From:	Fugang Duan <B38611@...escale.com>
To:	<davem@...emloft.net>, <b20596@...escale.com>
CC:	<netdev@...r.kernel.org>, <b38611@...escale.com>,
	<bhutchings@...arflare.com>, <l.stach@...gutronix.de>
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 |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 4ea1555..b13746f 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -380,7 +380,15 @@ 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) {
+		if (fep->bufdesc_ex)
+			bdp_pre = (struct bufdesc *)((void *)bdp +
+				(sizeof(struct bufdesc_ex) * (TX_RING_SIZE - 1)));
+		else
+			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