Commit 338feab5 authored by Scott Feldman's avatar Scott Feldman Committed by Jeff Garzik

[netdrvr e100] fix stray skb pointer

* Not setting cb->skb = NULL after releasing skb to OS or during
  initialization of cbs.  Reported by Deepak Saxena
  [dsaxena@plexity.net].
parent 17e2ec07
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
#define DRV_NAME "e100" #define DRV_NAME "e100"
#define DRV_VERSION "3.0.16" #define DRV_VERSION "3.0.17"
#define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver" #define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver"
#define DRV_COPYRIGHT "Copyright(c) 1999-2004 Intel Corporation" #define DRV_COPYRIGHT "Copyright(c) 1999-2004 Intel Corporation"
#define PFX DRV_NAME ": " #define PFX DRV_NAME ": "
...@@ -1285,6 +1285,7 @@ static inline int e100_tx_clean(struct nic *nic) ...@@ -1285,6 +1285,7 @@ static inline int e100_tx_clean(struct nic *nic)
le16_to_cpu(cb->u.tcb.tbd.size), le16_to_cpu(cb->u.tcb.tbd.size),
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
dev_kfree_skb_any(cb->skb); dev_kfree_skb_any(cb->skb);
cb->skb = NULL;
tx_cleaned = 1; tx_cleaned = 1;
} }
cb->status = 0; cb->status = 0;
...@@ -1347,6 +1348,7 @@ static int e100_alloc_cbs(struct nic *nic) ...@@ -1347,6 +1348,7 @@ static int e100_alloc_cbs(struct nic *nic)
cb->dma_addr = nic->cbs_dma_addr + i * sizeof(struct cb); cb->dma_addr = nic->cbs_dma_addr + i * sizeof(struct cb);
cb->link = cpu_to_le32(nic->cbs_dma_addr + cb->link = cpu_to_le32(nic->cbs_dma_addr +
((i+1) % count) * sizeof(struct cb)); ((i+1) % count) * sizeof(struct cb));
cb->skb = NULL;
} }
nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = nic->cbs; nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = nic->cbs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment