2009-11-13 14:43:08

by Matteo Croce

[permalink] [raw]
Subject: Re: R:Re: [ath9k-devel] Possible memory leak in ath9k monitor mode injection

On Fri, Nov 13, 2009 at 12:27 PM, <[email protected]> wrote:
> Il giorno , Lorenzo Bianconi <[email protected]> ha scritto:
>> 2009/11/13 Johannes Berg [email protected]>:
>> Yes, I tested ath5k/mac80211 and ath9k/mac80211 and both show the same
>> problem
>>
>> whereas madwifi/net80211, tested with the same module, has not memory
>> leak.
>>
>
> Hi all,
>
> I found a way to stop the mem leak. In the ath_tx_complete() function I have
> noticed that the struct tx_info_priv is not freed. I have made the following
> changes and now the memory remains stable. I do not know if this is the
> right place to put the kfree(tx_info_priv), however this seems to solve the
> issue.
>
> Cheers,
>
> Lorenzo
>
> @@ -1825,9 +1825,10 @@
> SC_OP_WAIT_FOR_TX_ACK));
> }
>
> - if (frame_type == ATH9K_NOT_INTERNAL)
> + if (frame_type == ATH9K_NOT_INTERNAL) {
> ieee80211_tx_status(hw, skb);
> - else
> + kfree(tx_info_priv);
> + } else
> ath9k_tx_status(hw, skb);
> }

What about adding that line in ieee80211_tx_status() instead of
ath_tx_complete()?
That will hopefully fix other drivers too.
I haven't a broadcom card to test b43 with


2009-11-13 14:47:18

by Johannes Berg

[permalink] [raw]
Subject: Re: R:Re: [ath9k-devel] Possible memory leak in ath9k monitor mode injection

On Fri, 2009-11-13 at 15:42 +0100, Matteo Croce wrote:

> > - if (frame_type == ATH9K_NOT_INTERNAL)
> > + if (frame_type == ATH9K_NOT_INTERNAL) {
> > ieee80211_tx_status(hw, skb);
> > - else
> > + kfree(tx_info_priv);
> > + } else
> > ath9k_tx_status(hw, skb);
> > }
>
> What about adding that line in ieee80211_tx_status() instead of
> ath_tx_complete()?
> That will hopefully fix other drivers too.

Umm, no, this is an atheros-ism that ought to be removed anyway, but
it's not possible this particular problem affects other drivers.

johannes


Attachments:
signature.asc (801.00 B)
This is a digitally signed message part