From: David S. Miller Date: Mon, 21 Jul 2008 01:13:01 +0000 (-0700) Subject: pkt_sched: Fix build with NET_SCHED disabled. X-Git-Tag: v2.6.27-rc1~964^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a682fbd732d3d27bec722a923952b0938e8a404;p=linux-2.6 pkt_sched: Fix build with NET_SCHED disabled. The stab bits can't be referenced uniless the full packet scheduler layer is enabled. Reported by Stephen Rothwell. Signed-off-by: David S. Miller --- diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index db9ad655eb..b5f40d7ef7 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -333,8 +333,10 @@ static inline unsigned int qdisc_pkt_len(struct sk_buff *skb) static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch) { +#ifdef CONFIG_NET_SCHED if (sch->stab) qdisc_calculate_pkt_len(skb, sch->stab); +#endif return sch->enqueue(skb, sch); } diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 27a51f04db..0ddf69286f 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -469,7 +469,9 @@ static void __qdisc_destroy(struct rcu_head *head) struct Qdisc *qdisc = container_of(head, struct Qdisc, q_rcu); const struct Qdisc_ops *ops = qdisc->ops; +#ifdef CONFIG_NET_SCHED qdisc_put_stab(qdisc->stab); +#endif gen_kill_estimator(&qdisc->bstats, &qdisc->rate_est); if (ops->reset) ops->reset(qdisc);