Commit ff31ab56 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

net-sched: change tcf_destroy_chain() to clear start of filter list



Pass double tcf_proto pointers to tcf_destroy_chain() to make it
clear the start of the filter list for more consistency.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 77a538d5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops);
extern struct Qdisc *qdisc_create_dflt(struct net_device *dev,
				       struct Qdisc_ops *ops, u32 parentid);
extern void tcf_destroy(struct tcf_proto *tp);
extern void tcf_destroy_chain(struct tcf_proto *fl);
extern void tcf_destroy_chain(struct tcf_proto **fl);

static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
				       struct sk_buff_head *list)
+1 −2
Original line number Diff line number Diff line
@@ -323,8 +323,7 @@ static void wme_qdiscop_destroy(struct Qdisc* qd)
	struct ieee80211_hw *hw = &local->hw;
	int queue;

	tcf_destroy_chain(q->filter_list);
	q->filter_list = NULL;
	tcf_destroy_chain(&q->filter_list);

	for (queue=0; queue < hw->queues; queue++) {
		skb_queue_purge(&q->requeued[queue]);
+3 −3
Original line number Diff line number Diff line
@@ -1252,12 +1252,12 @@ void tcf_destroy(struct tcf_proto *tp)
	kfree(tp);
}

void tcf_destroy_chain(struct tcf_proto *fl)
void tcf_destroy_chain(struct tcf_proto **fl)
{
	struct tcf_proto *tp;

	while ((tp = fl) != NULL) {
		fl = tp->next;
	while ((tp = *fl) != NULL) {
		*fl = tp->next;
		tcf_destroy(tp);
	}
}
+2 −3
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ static void atm_tc_put(struct Qdisc *sch, unsigned long cl)
	*prev = flow->next;
	pr_debug("atm_tc_put: qdisc %p\n", flow->q);
	qdisc_destroy(flow->q);
	tcf_destroy_chain(flow->filter_list);
	tcf_destroy_chain(&flow->filter_list);
	if (flow->sock) {
		pr_debug("atm_tc_put: f_count %d\n",
			file_count(flow->sock->file));
@@ -588,8 +588,7 @@ static void atm_tc_destroy(struct Qdisc *sch)
	pr_debug("atm_tc_destroy(sch %p,[qdisc %p])\n", sch, p);
	/* races ? */
	while ((flow = p->flows)) {
		tcf_destroy_chain(flow->filter_list);
		flow->filter_list = NULL;
		tcf_destroy_chain(&flow->filter_list);
		if (flow->ref > 1)
			printk(KERN_ERR "atm_destroy: %p->ref = %d\n", flow,
			       flow->ref);
+3 −5
Original line number Diff line number Diff line
@@ -1704,7 +1704,7 @@ static void cbq_destroy_class(struct Qdisc *sch, struct cbq_class *cl)

	BUG_TRAP(!cl->filters);

	tcf_destroy_chain(cl->filter_list);
	tcf_destroy_chain(&cl->filter_list);
	qdisc_destroy(cl->q);
	qdisc_put_rtab(cl->R_tab);
	gen_kill_estimator(&cl->bstats, &cl->rate_est);
@@ -1728,10 +1728,8 @@ cbq_destroy(struct Qdisc* sch)
	 * be bound to classes which have been destroyed already. --TGR '04
	 */
	for (h = 0; h < 16; h++) {
		for (cl = q->classes[h]; cl; cl = cl->next) {
			tcf_destroy_chain(cl->filter_list);
			cl->filter_list = NULL;
		}
		for (cl = q->classes[h]; cl; cl = cl->next)
			tcf_destroy_chain(&cl->filter_list);
	}
	for (h = 0; h < 16; h++) {
		struct cbq_class *next;
Loading