* [PATCH] lance.c - dev_kfree_skb() then reference skb->len
@ 2000-11-28 18:08 Eli Carter
2000-11-28 20:41 ` Donald Becker
0 siblings, 1 reply; 2+ messages in thread
From: Eli Carter @ 2000-11-28 18:08 UTC (permalink / raw)
To: linux-kernel, alan, becker
[-- Attachment #1: Type: text/plain, Size: 668 bytes --]
Greetings all,
Patch is against 2.2.17, drivers/net/lance.c.
I believe this to be "obviously correct," but please correct me if I'm
wrong.
This moves a reference to skb->len to before the possible
dev_kfree_skb(skb) call. Though it appears to work as is, I suspect it
is incorrect.
Please apply or let me know why.
Eli
ps. It's an attachment rather than inline because I can't seem to get
Netscape (4.71) to do that without replacing tabs with spaces. Grr.
--------------------. "To the systems programmer, users and applications
Eli Carter | serve only to provide a test load."
eli.carter@inet.com `---------------------------------- (random fortune)
[-- Attachment #2: lance.c.diff --]
[-- Type: text/plain, Size: 561 bytes --]
--- lance.c.2.2.17 Mon Nov 13 12:13:11 2000
+++ lance.c Tue Nov 28 11:46:16 2000
@@ -926,6 +926,8 @@
lp->tx_ring[entry].misc = 0x0000;
+ lp->stats.tx_bytes += skb->len;
+
/* If any part of this buffer is >16M we must copy it to a low-memory
buffer. */
if ((u32)virt_to_bus(skb->data) + skb->len > 0x01000000) {
@@ -941,7 +943,6 @@
lp->tx_ring[entry].base = ((u32)virt_to_bus(skb->data) & 0xffffff) | 0x83000000;
}
lp->cur_tx++;
- lp->stats.tx_bytes += skb->len;
/* Trigger an immediate send poll. */
outw(0x0000, ioaddr+LANCE_ADDR);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] lance.c - dev_kfree_skb() then reference skb->len
2000-11-28 18:08 [PATCH] lance.c - dev_kfree_skb() then reference skb->len Eli Carter
@ 2000-11-28 20:41 ` Donald Becker
0 siblings, 0 replies; 2+ messages in thread
From: Donald Becker @ 2000-11-28 20:41 UTC (permalink / raw)
To: Eli Carter; +Cc: linux-kernel, alan
On Tue, 28 Nov 2000, Eli Carter wrote:
> Patch is against 2.2.17, drivers/net/lance.c.
> I believe this to be "obviously correct," but please correct me if I'm
> wrong.
> This moves a reference to skb->len to before the possible
> dev_kfree_skb(skb) call. Though it appears to work as is, I suspect it
> is incorrect.
This patch looks reasonable.
Perhaps it would be better to have the driver retain the skbuff until the
transmit succeeds, and only then add the length to the stats. But this
specific bug is related the ISA bounce buffer code. Any ISA card is in
the "legacy" category, so it's better to make minimal change needed to
correct the obvious potential problem.
Donald Becker becker@scyld.com
Scyld Computing Corporation http://www.scyld.com
410 Severn Ave. Suite 210 Second Generation Beowulf Clusters
Annapolis MD 21403 410-990-9993
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-11-28 21:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-28 18:08 [PATCH] lance.c - dev_kfree_skb() then reference skb->len Eli Carter
2000-11-28 20:41 ` Donald Becker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox