Commit 5c5e1289 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: fix wme code

In commit e100bb64 (mac80211:
QoS related cleanups) I accidentally changed a variable from
int to u16 causing a warning that a comparison for < 0 was always
false. John thought this was a missing deletion of code and removed
the warning by deleting the never executed branch of code in commit
3df5ee60 (wireless: fix warning
introduced by "mac80211: QoS related cleanups") but the problem really
was my mistake of using a u16 variable for the queue variable when
that variable can also contain an error code. This patch restores
the original code and variable type.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 3df5ee60
...@@ -155,8 +155,7 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) ...@@ -155,8 +155,7 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
unsigned short fc = le16_to_cpu(hdr->frame_control); unsigned short fc = le16_to_cpu(hdr->frame_control);
struct Qdisc *qdisc; struct Qdisc *qdisc;
struct sta_info *sta; struct sta_info *sta;
int err; int err, queue;
u16 queue;
u8 tid; u8 tid;
if (pkt_data->flags & IEEE80211_TXPD_REQUEUE) { if (pkt_data->flags & IEEE80211_TXPD_REQUEUE) {
...@@ -216,6 +215,10 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) ...@@ -216,6 +215,10 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
rcu_read_unlock(); rcu_read_unlock();
} }
if (unlikely(queue < 0)) {
kfree_skb(skb);
err = NET_XMIT_DROP;
} else {
tid = skb->priority & QOS_CONTROL_TAG1D_MASK; tid = skb->priority & QOS_CONTROL_TAG1D_MASK;
pkt_data->queue = (unsigned int) queue; pkt_data->queue = (unsigned int) queue;
qdisc = q->queues[queue]; qdisc = q->queues[queue];
...@@ -226,6 +229,7 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) ...@@ -226,6 +229,7 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
qd->bstats.packets++; qd->bstats.packets++;
return NET_XMIT_SUCCESS; return NET_XMIT_SUCCESS;
} }
}
qd->qstats.drops++; qd->qstats.drops++;
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment