Commit 79fff937 authored by Mika Westerberg's avatar Mika Westerberg

thunderbolt: Unwind TMU configuration if tb_switch_set_tmu_mode_params() fails

Dan reported that the kernel test robot found an issue with the TMU code
namely in tb_switch_tmu_change_mode() where we should actually go back
to the previous mode in case of failure instead of just returning back
the error. Fix this by unwinding the configuration as we do with the
other error paths in this function.
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202311030814.AXtCk7PO-lkp@intel.com/Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent 655b8af5
......@@ -894,7 +894,7 @@ static int tb_switch_tmu_change_mode(struct tb_switch *sw)
ret = tb_switch_set_tmu_mode_params(sw, sw->tmu.mode_request);
if (ret)
return ret;
goto out;
/* Program the new mode and the downstream router lane adapter */
switch (sw->tmu.mode_request) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment