All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath9k: Fix memory leak due to failed PAPRD frames
@ 2011-01-31  7:55 Mohammed Shafi Shajakhan
  2011-01-31 18:43 ` Luis R. Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: Mohammed Shafi Shajakhan @ 2011-01-31  7:55 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, lrodriguez, Mohammed Shafi Shajakhan

From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>

free the skb's when the Tx of PAPRD frames fails and also add a debug
message indicating that.

Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
---
 drivers/net/wireless/ath/ath9k/main.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 20c70ba..1447b55 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -331,6 +331,8 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int
 {
 	struct ieee80211_hw *hw = sc->hw;
 	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
+	struct ath_hw *ah = sc->sc_ah;
+	struct ath_common *common = ath9k_hw_common(ah);
 	struct ath_tx_control txctl;
 	int time_left;
 
@@ -348,8 +350,12 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int
 	init_completion(&sc->paprd_complete);
 	sc->paprd_pending = true;
 	txctl.paprd = BIT(chain);
-	if (ath_tx_start(hw, skb, &txctl) != 0)
+
+	if (ath_tx_start(hw, skb, &txctl) != 0) {
+		ath_dbg(common, ATH_DBG_XMIT, "PAPRD TX failed\n");
+		dev_kfree_skb_any(skb);
 		return false;
+	}
 
 	time_left = wait_for_completion_timeout(&sc->paprd_complete,
 			msecs_to_jiffies(ATH_PAPRD_TIMEOUT));
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ath9k: Fix memory leak due to failed PAPRD frames
  2011-01-31  7:55 [PATCH] ath9k: Fix memory leak due to failed PAPRD frames Mohammed Shafi Shajakhan
@ 2011-01-31 18:43 ` Luis R. Rodriguez
  2011-02-01  4:41   ` Mohammed Shafi
  0 siblings, 1 reply; 5+ messages in thread
From: Luis R. Rodriguez @ 2011-01-31 18:43 UTC (permalink / raw)
  To: Mohammed Shafi Shajakhan; +Cc: linville, linux-wireless

On Sun, Jan 30, 2011 at 11:55 PM, Mohammed Shafi Shajakhan
<mshajakhan@atheros.com> wrote:
> From: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
>
> free the skb's when the Tx of PAPRD frames fails and also add a debug
> message indicating that.
>
> Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>

Is this a stable fix?

 Luis

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ath9k: Fix memory leak due to failed PAPRD frames
  2011-01-31 18:43 ` Luis R. Rodriguez
@ 2011-02-01  4:41   ` Mohammed Shafi
  2011-02-01 14:05     ` John W. Linville
  0 siblings, 1 reply; 5+ messages in thread
From: Mohammed Shafi @ 2011-02-01  4:41 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Mohammed Shajakhan, linville, linux-wireless

On Tuesday 01 February 2011 12:13 AM, Luis R. Rodriguez wrote:
> On Sun, Jan 30, 2011 at 11:55 PM, Mohammed Shafi Shajakhan
> <mshajakhan@atheros.com>  wrote:
>    
>> From: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
>>
>> free the skb's when the Tx of PAPRD frames fails and also add a debug
>> message indicating that.
>>
>> Signed-off-by: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
>>      
> Is this a stable fix?
>    
No Luis, this problem came from some recent changes in PAPRD before that 
it was Ok.
>   Luis
>    

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ath9k: Fix memory leak due to failed PAPRD frames
  2011-02-01  4:41   ` Mohammed Shafi
@ 2011-02-01 14:05     ` John W. Linville
  2011-02-01 15:04       ` Mohammed Shafi
  0 siblings, 1 reply; 5+ messages in thread
From: John W. Linville @ 2011-02-01 14:05 UTC (permalink / raw)
  To: Mohammed Shafi; +Cc: Luis R. Rodriguez, Mohammed Shajakhan, linux-wireless

On Tue, Feb 01, 2011 at 10:11:54AM +0530, Mohammed Shafi wrote:
> On Tuesday 01 February 2011 12:13 AM, Luis R. Rodriguez wrote:
> >On Sun, Jan 30, 2011 at 11:55 PM, Mohammed Shafi Shajakhan
> ><mshajakhan@atheros.com>  wrote:
> >>From: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
> >>
> >>free the skb's when the Tx of PAPRD frames fails and also add a debug
> >>message indicating that.
> >>
> >>Signed-off-by: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
> >Is this a stable fix?
> No Luis, this problem came from some recent changes in PAPRD before
> that it was Ok.

The patch applied to wireless-2.6 without changes, and the error
handling for ath_tx_start matched existing usage.  So, I have it
queued now in wireless-2.6 with an added "Cc: stable@kernel.org".

Should I not?

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ath9k: Fix memory leak due to failed PAPRD frames
  2011-02-01 14:05     ` John W. Linville
@ 2011-02-01 15:04       ` Mohammed Shafi
  0 siblings, 0 replies; 5+ messages in thread
From: Mohammed Shafi @ 2011-02-01 15:04 UTC (permalink / raw)
  To: John W. Linville; +Cc: Mohammed Shajakhan, Luis Rodriguez, linux-wireless

On Tuesday 01 February 2011 07:35 PM, John W. Linville wrote:
> On Tue, Feb 01, 2011 at 10:11:54AM +0530, Mohammed Shafi wrote:
>    
>> On Tuesday 01 February 2011 12:13 AM, Luis R. Rodriguez wrote:
>>      
>>> On Sun, Jan 30, 2011 at 11:55 PM, Mohammed Shafi Shajakhan
>>> <mshajakhan@atheros.com>   wrote:
>>>        
>>>> From: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
>>>>
>>>> free the skb's when the Tx of PAPRD frames fails and also add a debug
>>>> message indicating that.
>>>>
>>>> Signed-off-by: Mohammed Shafi Shajakhan<mshajakhan@atheros.com>
>>>>          
>>> Is this a stable fix?
>>>        
>> No Luis, this problem came from some recent changes in PAPRD before
>> that it was Ok.
>>      
> The patch applied to wireless-2.6 without changes, and the error
> handling for ath_tx_start matched existing usage.  So, I have it
> queued now in wireless-2.6 with an added "Cc: stable@kernel.org".
>
> Should I not?
>    
John this will be applicable for only 2.6.38 stable kernel.
The issue fixes for 2.6.37-rc5+  and this problem is not handled in the 
following commit id:

commit 7607cbe2ad6931400c5d15ced342ab329ab8f92c
Date:   Mon Dec 13 08:40:52 2010 +0100

This will not be even applicable for 2.6.37. It will introduce a 
regression of double freeing skb's.

thanks,
shafi


> John
>    

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-01 15:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-31  7:55 [PATCH] ath9k: Fix memory leak due to failed PAPRD frames Mohammed Shafi Shajakhan
2011-01-31 18:43 ` Luis R. Rodriguez
2011-02-01  4:41   ` Mohammed Shafi
2011-02-01 14:05     ` John W. Linville
2011-02-01 15:04       ` Mohammed Shafi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.