summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/main.c
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-10-11 13:52:25 +0200
committerLuciano Coelho <coelho@ti.com>2011-10-11 22:24:51 +0300
commit0f1680147ce2509383e053fa843020e0e9f3c6ce (patch)
tree575a9799f14fa4c129c7725d2725845926145b9f /drivers/net/wireless/wl12xx/main.c
parentccb62000d5e92772b6d5c2acce2f56263886ed89 (diff)
wl12xx: handle injected packets
Injected packets are sent with no vif, causing the wl12xx to NULL-dereference in multiple places. Furthermore, injected packets are currently not sent at all, as system_hlid doesn't belong to any specific role, so wl1271_skb_dequeue() never return its packets. Handle both these problems. Reported-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/main.c')
-rw-r--r--drivers/net/wireless/wl12xx/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index a2d16933ccb..f76be5ad8ab 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1477,11 +1477,14 @@ static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
struct wl1271 *wl = hw->priv;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_vif *vif = info->control.vif;
- struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
+ struct wl12xx_vif *wlvif = NULL;
unsigned long flags;
int q, mapping;
u8 hlid;
+ if (vif)
+ wlvif = wl12xx_vif_to_data(vif);
+
mapping = skb_get_queue_mapping(skb);
q = wl1271_tx_get_queue(mapping);
@@ -1491,7 +1494,7 @@ static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
/* queue the packet */
if (hlid == WL12XX_INVALID_LINK_ID ||
- !test_bit(hlid, wlvif->links_map)) {
+ (wlvif && !test_bit(hlid, wlvif->links_map))) {
wl1271_debug(DEBUG_TX, "DROP skb hlid %d q %d", hlid, q);
dev_kfree_skb(skb);
goto out;