From: Deepak Saxena <dsaxena@plexity.net>
To: jgarzik@pobox.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2.6-BK] Fix stray pointer in e100
Date: Fri, 12 Mar 2004 14:34:11 -0700 [thread overview]
Message-ID: <20040312213411.GA9939@plexity.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 401 bytes --]
e100_alloc_cbs() allocates the cb's but does not set cb->skb = NULL
which means that the following check in e100_tx_clean() will execute
even though cb->skb is not really a valid pointer an we OOPs:
if(likely(cb->skb != NULL)) {
...
nic->net_stats.tx_bytes += cb->skb->len;
}
Attached patch fixes the issue.
~Deepak
--
Deepak Saxena - dsaxena at plexity dot net - http://www.plexity.net/
[-- Attachment #2: patch-e100-cb-alloc --]
[-- Type: text/plain, Size: 414 bytes --]
diff -Nru a/drivers/net/e100.c b/drivers/net/e100.c
--- a/drivers/net/e100.c Fri Mar 12 14:26:45 2004
+++ b/drivers/net/e100.c Fri Mar 12 14:26:45 2004
@@ -1346,6 +1346,7 @@
cb->dma_addr = nic->cbs_dma_addr + i * sizeof(struct cb);
cb->link = cpu_to_le32(nic->cbs_dma_addr +
((i+1) % count) * sizeof(struct cb));
+ cb->skb = NULL;
}
nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = nic->cbs;
next reply other threads:[~2004-03-12 21:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-12 21:34 Deepak Saxena [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-03-12 23:21 [PATCH 2.6-BK] Fix stray pointer in e100 Feldman, Scott
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=20040312213411.GA9939@plexity.net \
--to=dsaxena@plexity.net \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.