* [PATCH 2.6-BK] Fix stray pointer in e100
@ 2004-03-12 21:34 Deepak Saxena
0 siblings, 0 replies; 2+ messages in thread
From: Deepak Saxena @ 2004-03-12 21:34 UTC (permalink / raw)
To: jgarzik; +Cc: linux-kernel
[-- 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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH 2.6-BK] Fix stray pointer in e100
@ 2004-03-12 23:21 Feldman, Scott
0 siblings, 0 replies; 2+ messages in thread
From: Feldman, Scott @ 2004-03-12 23:21 UTC (permalink / raw)
To: dsaxena, jgarzik; +Cc: linux-kernel
> 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:
Thanks Deepak. I found one other place where we need to set
cb->skb=NULL. Patch sent to Jeff upstream.
-scott
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-12 23:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-12 21:34 [PATCH 2.6-BK] Fix stray pointer in e100 Deepak Saxena
-- strict thread matches above, loose matches on Subject: below --
2004-03-12 23:21 Feldman, Scott
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox