Skip to content

Commit c155f7c

Browse files
Miriam-Racheljmberg-intel
authored andcommitted
wifi: iwlwifi: mld: inform trans on init failure
If starting the op mode failed, the opmode memory is being freed, so trans->op_mode needs to be NULLified. Otherwise, trans will access already freed memory. Call iwl_trans_op_mode_leave in that case. Fixes: d1e879e ("wifi: iwlwifi: add iwlmld sub-driver") Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250420095642.3331d1686556.Ifaf15bdd8ef8c59e04effbd2e7aa0034b30eeacb@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 4f7a077 commit c155f7c

File tree

1 file changed

+3
-2
lines changed
  • drivers/net/wireless/intel/iwlwifi/mld

1 file changed

+3
-2
lines changed

drivers/net/wireless/intel/iwlwifi/mld/mld.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ iwl_op_mode_mld_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
414414
wiphy_unlock(mld->wiphy);
415415
rtnl_unlock();
416416
iwl_fw_flush_dumps(&mld->fwrt);
417-
goto free_hw;
417+
goto err;
418418
}
419419

420420
/* We are about to stop the FW. Notifications may require an
@@ -460,7 +460,8 @@ iwl_op_mode_mld_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
460460
iwl_mld_leds_exit(mld);
461461
free_nvm:
462462
kfree(mld->nvm_data);
463-
free_hw:
463+
err:
464+
iwl_trans_op_mode_leave(mld->trans);
464465
ieee80211_free_hw(mld->hw);
465466
return ERR_PTR(ret);
466467
}

0 commit comments

Comments
 (0)