wifi: iwlwifi: mvm: fix potential memory leak
authorJohannes Berg <johannes.berg@intel.com>
Tue, 18 Apr 2023 09:28:08 +0000 (12:28 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 20 Apr 2023 09:45:55 +0000 (11:45 +0200)
commit457d7fb03e6c3d73fbb509bd85fc4b02d1ab405e
tree7d0e8b37cae93afa355eeaa3c4bafa2a42ce284d
parentf4d4ba4613dc92a58a8c051f7b6bcb0276b1fecc
wifi: iwlwifi: mvm: fix potential memory leak

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>
drivers/net/wireless/intel/iwlwifi/mvm/d3.c