]> www.infradead.org Git - users/jedix/linux-maple.git/commit
wifi: iwlwifi: mld: avoid memory leak if mcc_init fails
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 23 Apr 2025 06:16:33 +0000 (09:16 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 23 Apr 2025 13:37:38 +0000 (15:37 +0200)
commit092e9ca61f4b77cb2fea72a534c0f5a7a3b6b393
treec633de461797eb2926f45e681a5a055ddb90834f
parent834f6811afbfdcc2b73ad8a75f10c220f402f64e
wifi: iwlwifi: mld: avoid memory leak if mcc_init fails

allocating mld->nvm_data used to be the last thing done in
iwl_mld_load_fw, so there was no need to free on any error path of
iwl_mld_load_fw.
But now iwl_mld_load_fw also calls iwl_mld_init_mcc, that can fail,
after allocating nvm->data. In that case, it is not freed.

As allocating the NVM data should only be done at op mode start anyway,
simply move it to there, where it is already freed in the right error
paths.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250423091408.d07469f866ac.I84ad2e624ce7cd4a661c73b4942186e50cdf82b2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/fw.c
drivers/net/wireless/intel/iwlwifi/mld/mld.c