Message ID | 20201030101213.39165-1-zhangqilong3@huawei.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Luca Coelho |
Headers | show |
Series | iwlwifi: mvm: fix a memory leak in iwl_mvm_mac_ctxt_beacon_changed | expand |
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);
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(-)