aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_api.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-18 21:03:15 -0700
committerDavid S. Miller <davem@davemloft.net>2008-08-18 21:06:19 -0700
commit4d8863a29c4755a0461cd31b6865026187d6c43a (patch)
tree502b355314b1ff2e6cef52bf3778aba3bdae80cd /net/sched/sch_api.c
parentpkt_sched: Add lockdep annotation for qdisc locks (diff)
downloadlinux-dev-4d8863a29c4755a0461cd31b6865026187d6c43a.tar.xz
linux-dev-4d8863a29c4755a0461cd31b6865026187d6c43a.zip
pkt_sched: Don't hold qdisc lock over qdisc_destroy().
Based upon reports by Denys Fedoryshchenko, and feedback and help from Jarek Poplawski and Herbert Xu. We always either: 1) Never made an external reference to this qdisc. or 2) Did a dev_deactivate() which purged all asynchronous references. So do not lock the qdisc when we call qdisc_destroy(), it's illegal anyways as when we drop the lock this is free'd memory. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r--net/sched/sch_api.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 7d7070b1eebd..d91a2338877c 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -638,11 +638,8 @@ static void notify_and_destroy(struct sk_buff *skb, struct nlmsghdr *n, u32 clid
if (new || old)
qdisc_notify(skb, n, clid, old, new);
- if (old) {
- sch_tree_lock(old);
+ if (old)
qdisc_destroy(old);
- sch_tree_unlock(old);
- }
}
/* Graft qdisc "new" to class "classid" of qdisc "parent" or
@@ -1092,16 +1089,10 @@ create_n_graft:
graft:
if (1) {
- spinlock_t *root_lock;
-
err = qdisc_graft(dev, p, skb, n, clid, q, NULL);
if (err) {
- if (q) {
- root_lock = qdisc_root_lock(q);
- spin_lock_bh(root_lock);
+ if (q)
qdisc_destroy(q);
- spin_unlock_bh(root_lock);
- }
return err;
}
}