Skip to content

Commit

Permalink
pkt_sched: Grab correct lock in notify_and_destroy().
Browse files Browse the repository at this point in the history
From: Jarek Poplawski <jarkao2@gmail.com>

When we are destroying non-root qdiscs, we need to lock
the root of the qdisc tree not the the qdisc itself.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Aug 18, 2008
1 parent 4335cd2 commit 3a76e37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,9 @@ static void notify_and_destroy(struct sk_buff *skb, struct nlmsghdr *n, u32 clid
qdisc_notify(skb, n, clid, old, new);

if (old) {
spin_lock_bh(&old->q.lock);
sch_tree_lock(old);
qdisc_destroy(old);
spin_unlock_bh(&old->q.lock);
sch_tree_unlock(old);
}
}

Expand Down

0 comments on commit 3a76e37

Please sign in to comment.