2011-12-13 11:26:45

by Eliad Peller

[permalink] [raw]
Subject: [PATCH] wl12xx: use ieee80211_free_txskb()

Use the newly introduced ieee80211_free_txskb() instead
of dev_kfree_skb() for failed tx packets.

Reported-by: Arik Nemtsov <[email protected]>
Signed-off-by: Eliad Peller <[email protected]>
---
drivers/net/wireless/wl12xx/main.c | 2 +-
drivers/net/wireless/wl12xx/tx.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 2f7bfa8..333bc29 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1448,7 +1448,7 @@ static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
if (hlid == WL12XX_INVALID_LINK_ID ||
(wlvif && !test_bit(hlid, wlvif->links_map))) {
wl1271_debug(DEBUG_TX, "DROP skb hlid %d q %d", hlid, q);
- dev_kfree_skb(skb);
+ ieee80211_free_txskb(hw, skb);
goto out;
}

diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
index 36eb0d6..fe62f21 100644
--- a/drivers/net/wireless/wl12xx/tx.c
+++ b/drivers/net/wireless/wl12xx/tx.c
@@ -740,7 +740,7 @@ void wl1271_tx_work_locked(struct wl1271 *wl)
set_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags);
goto out_ack;
} else if (ret < 0) {
- dev_kfree_skb(skb);
+ ieee80211_free_txskb(wl->hw, skb);
goto out_ack;
}
buf_offset += ret;
--
1.7.6.401.g6a319



2011-12-13 11:32:14

by Arik Nemtsov

[permalink] [raw]
Subject: Re: [PATCH] wl12xx: use ieee80211_free_txskb()

On Tue, Dec 13, 2011 at 13:27, Eliad Peller <[email protected]> wrote:
> Use the newly introduced ieee80211_free_txskb() instead
> of dev_kfree_skb() for failed tx packets.
>
> Reported-by: Arik Nemtsov <[email protected]>
> Signed-off-by: Eliad Peller <[email protected]>
> ---
> ?drivers/net/wireless/wl12xx/main.c | ? ?2 +-
> ?drivers/net/wireless/wl12xx/tx.c ? | ? ?2 +-
> ?2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
> index 2f7bfa8..333bc29 100644
> --- a/drivers/net/wireless/wl12xx/main.c
> +++ b/drivers/net/wireless/wl12xx/main.c
[..]
>
> diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
> index 36eb0d6..fe62f21 100644
> --- a/drivers/net/wireless/wl12xx/tx.c
> +++ b/drivers/net/wireless/wl12xx/tx.c
> @@ -740,7 +740,7 @@ void wl1271_tx_work_locked(struct wl1271 *wl)
> ? ? ? ? ? ? ? ? ? ? ? ?set_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags);
> ? ? ? ? ? ? ? ? ? ? ? ?goto out_ack;
> ? ? ? ? ? ? ? ?} else if (ret < 0) {
> - ? ? ? ? ? ? ? ? ? ? ? dev_kfree_skb(skb);
> + ? ? ? ? ? ? ? ? ? ? ? ieee80211_free_txskb(wl->hw, skb);

Technically, the skb can be a dummy packet here. In this case we
shouldn't do anything. This was a bug before, but it's even more of a
bug now.

Arik