summaryrefslogtreecommitdiff
path: root/net/mac80211/wme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/wme.c')
-rw-r--r--net/mac80211/wme.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index b1e20ca03ff..8ffff27fe00 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -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);
struct Qdisc *qdisc;
struct sta_info *sta;
- int err;
- u16 queue;
+ int err, queue;
u8 tid;
if (pkt_data->flags & IEEE80211_TXPD_REQUEUE) {
@@ -216,15 +215,20 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
rcu_read_unlock();
}
- tid = skb->priority & QOS_CONTROL_TAG1D_MASK;
- pkt_data->queue = (unsigned int) queue;
- qdisc = q->queues[queue];
- err = qdisc->enqueue(skb, qdisc);
- if (err == NET_XMIT_SUCCESS) {
- qd->q.qlen++;
- qd->bstats.bytes += skb->len;
- qd->bstats.packets++;
- return NET_XMIT_SUCCESS;
+ if (unlikely(queue < 0)) {
+ kfree_skb(skb);
+ err = NET_XMIT_DROP;
+ } else {
+ tid = skb->priority & QOS_CONTROL_TAG1D_MASK;
+ pkt_data->queue = (unsigned int) queue;
+ qdisc = q->queues[queue];
+ err = qdisc->enqueue(skb, qdisc);
+ if (err == NET_XMIT_SUCCESS) {
+ qd->q.qlen++;
+ qd->bstats.bytes += skb->len;
+ qd->bstats.packets++;
+ return NET_XMIT_SUCCESS;
+ }
}
qd->qstats.drops++;
return err;