linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: mvm: fix a memory leak in iwl_mvm_mac_ctxt_beacon_changed
@ 2020-11-19 12:46 Zhang Qilong
  2021-03-23  9:04 ` Coelho, Luciano
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang Qilong @ 2020-11-19 12:46 UTC (permalink / raw)
  To: kvalo, davem, kuba
  Cc: johannes.berg, emmanuel.grumbach, luciano.coelho, linuxwifi,
	linux-wireless

In the error path of iwl_mvm_mac_ctxt_beacon_changed,
the beacon it not be freed, and use dev_kfree_skb to
free it.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
index 8698ca4d30de..e9a804ffd984 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
@@ -1044,8 +1044,10 @@ int iwl_mvm_mac_ctxt_beacon_changed(struct iwl_mvm *mvm,
 		return -ENOMEM;
 
 #ifdef CONFIG_IWLWIFI_DEBUGFS
-	if (mvm->beacon_inject_active)
+	if (mvm->beacon_inject_active) {
+		dev_kfree_skb(beacon);
 		return -EBUSY;
+	}
 #endif
 
 	ret = iwl_mvm_mac_ctxt_send_beacon(mvm, vif, beacon);
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH] iwlwifi: mvm: fix a memory leak in iwl_mvm_mac_ctxt_beacon_changed
@ 2020-10-30 10:12 Zhang Qilong
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang Qilong @ 2020-10-30 10:12 UTC (permalink / raw)
  To: kvalo, davem, kuba
  Cc: johannes.berg, emmanuel.grumbach, luciano.coelho, linuxwifi,
	linux-wireless, netdev

In the error path of iwl_mvm_mac_ctxt_beacon_changed,
the beacon it not be freed, and use dev_kfree_skb to
free it.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
index cbdebefb854a..6f5951aed8a7 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
@@ -1044,8 +1044,10 @@ int iwl_mvm_mac_ctxt_beacon_changed(struct iwl_mvm *mvm,
 		return -ENOMEM;
 
 #ifdef CONFIG_IWLWIFI_DEBUGFS
-	if (mvm->beacon_inject_active)
+	if (mvm->beacon_inject_active) {
+		dev_kfree_skb(beacon);
 		return -EBUSY;
+	}
 #endif
 
 	ret = iwl_mvm_mac_ctxt_send_beacon(mvm, vif, beacon);
-- 
2.17.1


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

end of thread, other threads:[~2021-03-23  9:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 12:46 [PATCH] iwlwifi: mvm: fix a memory leak in iwl_mvm_mac_ctxt_beacon_changed Zhang Qilong
2021-03-23  9:04 ` Coelho, Luciano
  -- strict thread matches above, loose matches on Subject: below --
2020-10-30 10:12 Zhang Qilong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).