diff options
author | Haim Dreyfuss <haim.dreyfuss@intel.com> | 2015-05-20 08:10:43 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-06-06 08:21:07 -0700 |
commit | d31b01fafb8e1fa260a96113bafe9c531c152e98 (patch) | |
tree | b855362aa9597a2858df1d690b21204997f9c6a0 | |
parent | 73fd965093417091ace8fb526da9f81261171589 (diff) |
iwlwifi: mvm: Free fw_status after use to avoid memory leak
commit 2fc863a5143d64b8f06576cc3d7fd5622c5cf3b5 upstream.
fw_status is the only pointer pointing to a block of memory
allocated above and should be freed after use.
Note: this come from Klockwork static analyzer.
Fixes: 2021a89d7b8a ("iwlwifi: mvm: treat netdetect wake up separately")
Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/d3.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c index 116fc74fa6ce..fd5a0bb1493f 100644 --- a/drivers/net/wireless/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/iwlwifi/mvm/d3.c @@ -1742,8 +1742,10 @@ static void iwl_mvm_query_netdetect_reasons(struct iwl_mvm *mvm, int i, j, n_matches, ret; fw_status = iwl_mvm_get_wakeup_status(mvm, vif); - if (!IS_ERR_OR_NULL(fw_status)) + if (!IS_ERR_OR_NULL(fw_status)) { reasons = le32_to_cpu(fw_status->wakeup_reasons); + kfree(fw_status); + } if (reasons & IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED) wakeup.rfkill_release = true; |