* [PATCH] mac80211: fix memory leak in ieee80211_send_probe_req
@ 2010-01-15 13:44 tom.leiming
2010-01-15 14:19 ` Kalle Valo
0 siblings, 1 reply; 5+ messages in thread
From: tom.leiming @ 2010-01-15 13:44 UTC (permalink / raw)
To: kalle.valo; +Cc: linux-wireless, johannes, Ming Lei
From: Ming Lei <tom.leiming@gmail.com>
This patch fixes memory leak in ieee80211_send_probe_req, which
is introduced in 7c12ce8b854df346388ea56d684784e3484012cf:
mac80211: use Probe Request template when sending a direct scan
The patch is against the latest wireless-test tree.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
net/mac80211/util.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index e278f97..ca170b4 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1028,6 +1028,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
ieee80211_tx_skb(sdata, skb);
+ kfree(buf);
}
u32 ieee80211_sta_get_rates(struct ieee80211_local *local,
--
1.6.2.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: fix memory leak in ieee80211_send_probe_req
2010-01-15 13:44 [PATCH] mac80211: fix memory leak in ieee80211_send_probe_req tom.leiming
@ 2010-01-15 14:19 ` Kalle Valo
2010-01-15 14:36 ` Ming Lei
2010-01-15 14:36 ` Kalle Valo
0 siblings, 2 replies; 5+ messages in thread
From: Kalle Valo @ 2010-01-15 14:19 UTC (permalink / raw)
To: tom.leiming@gmail.com
Cc: linux-wireless@vger.kernel.org, johannes@sipsolutions.net
"ext tom.leiming@gmail.com" <tom.leiming@gmail.com> writes:
> From: Ming Lei <tom.leiming@gmail.com>
>
> This patch fixes memory leak in ieee80211_send_probe_req, which
> is introduced in 7c12ce8b854df346388ea56d684784e3484012cf:
>
> mac80211: use Probe Request template when sending a direct scan
Sorry, I introduced this bug. Thank you finding this.
> The patch is against the latest wireless-test tree.
You should add comments like this after the "---" line.
> @@ -1028,6 +1028,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
>
> IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
> ieee80211_tx_skb(sdata, skb);
> + kfree(buf);
Better to use dev_kfree_skb() here.
Can you resend, please?
--
Kalle Valo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: fix memory leak in ieee80211_send_probe_req
2010-01-15 14:19 ` Kalle Valo
2010-01-15 14:36 ` Ming Lei
@ 2010-01-15 14:36 ` Kalle Valo
1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2010-01-15 14:36 UTC (permalink / raw)
To: tom.leiming@gmail.com
Cc: linux-wireless@vger.kernel.org, johannes@sipsolutions.net
Kalle Valo <kalle.valo@iki.fi> writes:
> "ext tom.leiming@gmail.com" <tom.leiming@gmail.com> writes:
>
>> From: Ming Lei <tom.leiming@gmail.com>
>>
>> This patch fixes memory leak in ieee80211_send_probe_req, which
>> is introduced in 7c12ce8b854df346388ea56d684784e3484012cf:
>>
>> mac80211: use Probe Request template when sending a direct scan
>
[...]
>> @@ -1028,6 +1028,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
>>
>> IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
>> ieee80211_tx_skb(sdata, skb);
>> + kfree(buf);
>
> Better to use dev_kfree_skb() here.
I don't know what I was thinking when I sent the previous email :)
After second look, this looks good.
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
--
Kalle Valo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: fix memory leak in ieee80211_send_probe_req
2010-01-15 14:19 ` Kalle Valo
@ 2010-01-15 14:36 ` Ming Lei
2010-01-15 14:53 ` Kalle Valo
2010-01-15 14:36 ` Kalle Valo
1 sibling, 1 reply; 5+ messages in thread
From: Ming Lei @ 2010-01-15 14:36 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless@vger.kernel.org, johannes@sipsolutions.net
2010/1/15 Kalle Valo <kalle.valo@iki.fi>:
> "ext tom.leiming@gmail.com" <tom.leiming@gmail.com> writes:
>
>> From: Ming Lei <tom.leiming@gmail.com>
>>
>> This patch fixes memory leak in ieee80211_send_probe_req, which
>> is introduced in 7c12ce8b854df346388ea56d684784e3484012cf:
>>
>> mac80211: use Probe Request template when sending a direct scan
>
>
> Sorry, I introduced this bug. Thank you finding this.
>
>> The patch is against the latest wireless-test tree.
>
> You should add comments like this after the "---" line.
>
>> @@ -1028,6 +1028,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
>>
>> IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
>> ieee80211_tx_skb(sdata, skb);
>> + kfree(buf);
>
> Better to use dev_kfree_skb() here.
Why is dev_kfree_skb better?
It is 'buf' allocated in ieee80211_send_probe_req to be freed, not skb.
>
> Can you resend, please?
OK.
--
Lei Ming
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mac80211: fix memory leak in ieee80211_send_probe_req
2010-01-15 14:36 ` Ming Lei
@ 2010-01-15 14:53 ` Kalle Valo
0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2010-01-15 14:53 UTC (permalink / raw)
To: Ming Lei; +Cc: linux-wireless@vger.kernel.org, johannes@sipsolutions.net
Ming Lei <tom.leiming@gmail.com> writes:
>>> IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
>>> ieee80211_tx_skb(sdata, skb);
>>> + kfree(buf);
>>
>> Better to use dev_kfree_skb() here.
>
> Why is dev_kfree_skb better?
> It is 'buf' allocated in ieee80211_send_probe_req to be freed, not skb.
Yes, I misread your patch first. Please forget that comment :)
--
Kalle Valo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-01-15 14:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-15 13:44 [PATCH] mac80211: fix memory leak in ieee80211_send_probe_req tom.leiming
2010-01-15 14:19 ` Kalle Valo
2010-01-15 14:36 ` Ming Lei
2010-01-15 14:53 ` Kalle Valo
2010-01-15 14:36 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox