From: Florian Fainelli <florian@openwrt.org>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, Florian Fainelli <florian@openwrt.org>
Subject: [PATCH net-next 2/2] r6040: use ETH_ZLEN instead of MISR for SKB length checking
Date: Wed, 15 Jan 2014 13:04:26 -0800 [thread overview]
Message-ID: <1389819866-32142-3-git-send-email-florian@openwrt.org> (raw)
In-Reply-To: <1389819866-32142-1-git-send-email-florian@openwrt.org>
Ever since this driver was merged the following code was included:
if (skb->len < MISR)
skb->len = MISR;
MISR is defined to 0x3C which is also equivalent to ETH_ZLEN, but use
ETH_ZLEN directly which is exactly what we want to be checking for.
Reported-by: Marc Volovic <marcv@ezchip.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
drivers/net/ethernet/rdc/r6040.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
index ff4683a..eb15ebf 100644
--- a/drivers/net/ethernet/rdc/r6040.c
+++ b/drivers/net/ethernet/rdc/r6040.c
@@ -836,8 +836,8 @@ static netdev_tx_t r6040_start_xmit(struct sk_buff *skb,
/* Set TX descriptor & Transmit it */
lp->tx_free_desc--;
descptr = lp->tx_insert_ptr;
- if (skb->len < MISR)
- descptr->len = MISR;
+ if (skb->len < ETH_ZLEN)
+ descptr->len = ETH_ZLEN;
else
descptr->len = skb->len;
--
1.8.3.2
next prev parent reply other threads:[~2014-01-15 21:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 21:04 [PATCH net-next 0/2] r6040: misc fixes Florian Fainelli
2014-01-15 21:04 ` [PATCH net-next 1/2] r6040: add delays in MDIO read/write polling loops Florian Fainelli
2014-01-15 21:04 ` Florian Fainelli [this message]
2014-01-16 7:23 ` [PATCH net-next 2/2] r6040: use ETH_ZLEN instead of MISR for SKB length checking Ben Hutchings
2014-01-16 9:10 ` David Laight
2014-01-16 17:33 ` Ben Hutchings
2014-01-16 19:30 ` Florian Fainelli
2014-01-17 0:24 ` [PATCH net-next 0/2] r6040: misc fixes David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389819866-32142-3-git-send-email-florian@openwrt.org \
--to=florian@openwrt.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox