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>
Mon, 5 Jun 2023 07:26:20 +0000 (09:26 +0200)
commit592af07ac0c87c103f321d0b69768997cc00ffc4
treea593363fad9868fcaff3d9203b7c213ffd6cb4c2
parent0c469078bde4dd60aea5111cf8f3b35cb5aa45c2
wifi: iwlwifi: mvm: fix potential memory leak

[ 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