瀏覽代碼

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 <davem@davemloft.net>
David S. Miller 17 年之前
父節點
當前提交
3a682fbd73
共有 2 個文件被更改,包括 4 次插入0 次删除
  1. 2 0
      include/net/sch_generic.h
  2. 2 0
      net/sched/sch_generic.c

+ 2 - 0
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);
 }
 

+ 2 - 0
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);