]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: mvm: fix potential memory leak
authorJohannes Berg <johannes.berg@intel.com>
Tue, 18 Apr 2023 09:28:08 +0000 (12:28 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 11:58:55 +0000 (13:58 +0200)
[ Upstream commit 457d7fb03e6c3d73fbb509bd85fc4b02d1ab405e ]

If we do get multiple notifications from firmware, then
we might have allocated 'notif', but don't free it. Fix
that by checking for duplicates before allocation.

Fixes: 4da46a06d443 ("wifi: iwlwifi: mvm: Add support for wowlan info notification")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230418122405.116758321cc4.I8bdbcbb38c89ac637eaa20dda58fa9165b25893a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/mvm/d3.c

index 29f75948ab00ce05a374d2faba879bca6cb0acb2..fe2de813fbf49c4a1fd232bcb0de5d7397517ece 100644 (file)
@@ -2715,6 +2715,7 @@ static bool iwl_mvm_wait_d3_notif(struct iwl_notif_wait_data *notif_wait,
                        break;
                }
 
+
                d3_data->notif_received |= IWL_D3_NOTIF_WOWLAN_INFO;
                len = iwl_rx_packet_payload_len(pkt);
                iwl_mvm_parse_wowlan_info_notif(mvm, notif, d3_data->status,