Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:53026 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752951AbbFCGf1 (ORCPT ); Wed, 3 Jun 2015 02:35:27 -0400 Subject: Patch "iwlwifi: mvm: Free fw_status after use to avoid memory leak" has been added to the 4.0-stable tree To: haim.dreyfuss@intel.com, emmanuel.grumbach@intel.com, gregkh@linuxfoundation.org Cc: , From: Date: Wed, 03 Jun 2015 15:35:08 +0900 Message-ID: <14333133082616@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled iwlwifi: mvm: Free fw_status after use to avoid memory leak to the 4.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: iwlwifi-mvm-free-fw_status-after-use-to-avoid-memory-leak.patch and it can be found in the queue-4.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From 2fc863a5143d64b8f06576cc3d7fd5622c5cf3b5 Mon Sep 17 00:00:00 2001 From: Haim Dreyfuss Date: Wed, 20 May 2015 08:10:43 +0300 Subject: iwlwifi: mvm: Free fw_status after use to avoid memory leak From: Haim Dreyfuss 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 Signed-off-by: Emmanuel Grumbach Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/iwlwifi/mvm/d3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- 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_reas 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; Patches currently in stable-queue which might be from haim.dreyfuss@intel.com are queue-4.0/iwlwifi-mvm-free-fw_status-after-use-to-avoid-memory-leak.patch