summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/tmu.c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2023-11-07 13:06:25 +0200
committerMika Westerberg <mika.westerberg@linux.intel.com>2023-12-14 08:07:44 +0200
commit79fff9379e6c928d376e5d8f7f63894ebff67865 (patch)
tree40f13416246b0f843d2f2fc58b3fdb3509b65e8e /drivers/thunderbolt/tmu.c
parent655b8af57d31e07340b023a807e43dadf81a0818 (diff)
downloadlwn-79fff9379e6c928d376e5d8f7f63894ebff67865.tar.gz
lwn-79fff9379e6c928d376e5d8f7f63894ebff67865.zip
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: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202311030814.AXtCk7PO-lkp@intel.com/ Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/tmu.c')
-rw-r--r--drivers/thunderbolt/tmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thunderbolt/tmu.c b/drivers/thunderbolt/tmu.c
index 11f2aec2a5d3..9a259c72e5a7 100644
--- a/drivers/thunderbolt/tmu.c
+++ b/drivers/thunderbolt/tmu.c
@@ -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) {