ATH10K Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ath10k: memory leak fixes
@ 2013-10-28  6:18 Michal Kazior
  2013-10-28  6:18 ` [PATCH 1/2] ath10k: plug memory leak in wmi mgmt tx worker Michal Kazior
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michal Kazior @ 2013-10-28  6:18 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Michal Kazior

Michal Kazior (2):
  ath10k: plug memory leak in wmi mgmt tx worker
  ath10k: plug memory leak on beacon tx

 drivers/net/wireless/ath/ath10k/mac.c |  4 +++-
 drivers/net/wireless/ath/ath10k/wmi.c | 11 +++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

-- 
1.8.4.rc3


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* [PATCH 1/2] ath10k: plug memory leak in wmi mgmt tx worker
  2013-10-28  6:18 [PATCH 0/2] ath10k: memory leak fixes Michal Kazior
@ 2013-10-28  6:18 ` Michal Kazior
  2013-10-28  6:18 ` [PATCH 2/2] ath10k: plug memory leak on beacon tx Michal Kazior
  2013-10-30  9:53 ` [PATCH 0/2] ath10k: memory leak fixes Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Michal Kazior @ 2013-10-28  6:18 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Michal Kazior

sk_buff was not freed in some cases. The patch
unifies the msdu freeing.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 4 +++-
 drivers/net/wireless/ath/ath10k/wmi.c | 4 +---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index bbb0efa..f45eca0 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1729,8 +1729,10 @@ void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work)
 			break;
 
 		ret = ath10k_wmi_mgmt_tx(ar, skb);
-		if (ret)
+		if (ret) {
 			ath10k_warn("wmi mgmt_tx failed (%d)\n", ret);
+			ieee80211_free_txskb(ar->hw, skb);
+		}
 	}
 }
 
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index a796d0b..8db9db2 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -674,10 +674,8 @@ int ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *skb)
 
 	/* Send the management frame buffer to the target */
 	ret = ath10k_wmi_cmd_send(ar, wmi_skb, ar->wmi.cmd->mgmt_tx_cmdid);
-	if (ret) {
-		dev_kfree_skb_any(skb);
+	if (ret)
 		return ret;
-	}
 
 	/* TODO: report tx status to mac80211 - temporary just ACK */
 	info->flags |= IEEE80211_TX_STAT_ACK;
-- 
1.8.4.rc3


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* [PATCH 2/2] ath10k: plug memory leak on beacon tx
  2013-10-28  6:18 [PATCH 0/2] ath10k: memory leak fixes Michal Kazior
  2013-10-28  6:18 ` [PATCH 1/2] ath10k: plug memory leak in wmi mgmt tx worker Michal Kazior
@ 2013-10-28  6:18 ` Michal Kazior
  2013-10-30  9:53 ` [PATCH 0/2] ath10k: memory leak fixes Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Michal Kazior @ 2013-10-28  6:18 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Michal Kazior

If beacon tx command failed the wmi command buffer
was not freed. This led to OOM in the long run.
This became aparent when stress testing
multi-BSSID.

Reported-By: Tomasz Skapski <tomasz.skapski@tieto.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
 drivers/net/wireless/ath/ath10k/wmi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 8db9db2..f79f17c 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -3092,6 +3092,7 @@ int ath10k_wmi_beacon_send_nowait(struct ath10k *ar,
 {
 	struct wmi_bcn_tx_cmd *cmd;
 	struct sk_buff *skb;
+	int ret;
 
 	skb = ath10k_wmi_alloc_skb(sizeof(*cmd) + arg->bcn_len);
 	if (!skb)
@@ -3104,7 +3105,11 @@ int ath10k_wmi_beacon_send_nowait(struct ath10k *ar,
 	cmd->hdr.bcn_len  = __cpu_to_le32(arg->bcn_len);
 	memcpy(cmd->bcn, arg->bcn, arg->bcn_len);
 
-	return ath10k_wmi_cmd_send_nowait(ar, skb, ar->wmi.cmd->bcn_tx_cmdid);
+	ret = ath10k_wmi_cmd_send_nowait(ar, skb, ar->wmi.cmd->bcn_tx_cmdid);
+	if (ret)
+		dev_kfree_skb(skb);
+
+	return ret;
 }
 
 static void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params,
-- 
1.8.4.rc3


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH 0/2] ath10k: memory leak fixes
  2013-10-28  6:18 [PATCH 0/2] ath10k: memory leak fixes Michal Kazior
  2013-10-28  6:18 ` [PATCH 1/2] ath10k: plug memory leak in wmi mgmt tx worker Michal Kazior
  2013-10-28  6:18 ` [PATCH 2/2] ath10k: plug memory leak on beacon tx Michal Kazior
@ 2013-10-30  9:53 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2013-10-30  9:53 UTC (permalink / raw)
  To: Michal Kazior; +Cc: linux-wireless, ath10k

Michal Kazior <michal.kazior@tieto.com> writes:

> Michal Kazior (2):
>   ath10k: plug memory leak in wmi mgmt tx worker
>   ath10k: plug memory leak on beacon tx

Thanks, both patches applied.

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

end of thread, other threads:[~2013-10-30  9:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-28  6:18 [PATCH 0/2] ath10k: memory leak fixes Michal Kazior
2013-10-28  6:18 ` [PATCH 1/2] ath10k: plug memory leak in wmi mgmt tx worker Michal Kazior
2013-10-28  6:18 ` [PATCH 2/2] ath10k: plug memory leak on beacon tx Michal Kazior
2013-10-30  9:53 ` [PATCH 0/2] ath10k: memory leak fixes Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox