Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChas Williams <chas@cmf.nrl.navy.mil>2003-10-16 11:11:19 -0700
committerStephen Hemminger <shemminger@osdl.org>2003-10-16 11:11:19 -0700
commit5b7854ddd8dbfde6da2a90645b835b73ff5e6860 (patch)
treed3d5e058e3aaef2386b013672dee1b196b4f4e59
parent54d26813da1996348e864b6e9d56f4006bf1cf18 (diff)
[ATM]: Remove vcc reference on outstanding SKBs
-rw-r--r--drivers/atm/nicstar.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 4fd82600163c..2473dc58e52a 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -1676,6 +1676,25 @@ static void ns_close(struct atm_vcc *vcc)
free_scq(vc->scq, vcc);
}
+ /* remove all references to vcc before deleting it */
+ if (vcc->qos.txtp.traffic_class != ATM_NONE)
+ {
+ unsigned long flags;
+ scq_info *scq = card->scq0;
+
+ ns_grab_scq_lock(card, scq, flags);
+
+ for(i = 0; i < scq->num_entries; i++) {
+ if(scq->skb[i] && ATM_SKB(scq->skb[i])->vcc == vcc) {
+ ATM_SKB(scq->skb[i])->vcc = NULL;
+ atm_return(vcc, scq->skb[i]->truesize);
+ PRINTK("nicstar: deleted pending vcc mapping\n");
+ }
+ }
+
+ spin_unlock_irqrestore(&scq->lock, flags);
+ }
+
vcc->dev_data = NULL;
clear_bit(ATM_VF_PARTIAL,&vcc->flags);
clear_bit(ATM_VF_ADDR,&vcc->flags);
@@ -2074,7 +2093,7 @@ static void drain_scq(ns_dev *card, scq_info *scq, int pos)
if (skb != NULL)
{
vcc = ATM_SKB(skb)->vcc;
- if (vcc->pop != NULL) {
+ if (vcc && vcc->pop != NULL) {
vcc->pop(vcc, skb);
} else {
dev_kfree_skb_irq(skb);