提交 5a78ba4d 编写于 作者: Z Zhang Qilong 提交者: Zheng Zengkai

iwlwifi: mvm: fix a memory leak in iwl_mvm_mac_ctxt_beacon_changed

stable inclusion
from stable-5.10.67
commit 3ed8982df50ed30165e1f2148958def2bb6dc2e1
bugzilla: 182619 https://gitee.com/openeuler/kernel/issues/I4EWO7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3ed8982df50ed30165e1f2148958def2bb6dc2e1

--------------------------------

[ Upstream commit 0f5d44ac ]

If beacon_inject_active is true, we will return without freeing
beacon.  Fid that by freeing it before returning.
Signed-off-by: NZhang Qilong <zhangqilong3@huawei.com>
[reworded the commit message]
Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.d16206ca60fc.I9984a9b442c84814c307cee3213044e24d26f38a@changeidSigned-off-by: NLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 aef7687a
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册