Skip to content

Commit 49c98b5

Browse files
Prashant Malanigregkh
authored andcommitted
platform/chrome: cros_ec_typec: Cleanup switch handle return paths
[ Upstream commit 66fe238 ] Some of the return paths for the cros_typec_get_switch_handles() aren't necessary. Clean up the return paths to only undo the handle get's which succeeded. Signed-off-by: Prashant Malani <pmalani@chromium.org> Link: https://lore.kernel.org/r/20220711072333.2064341-9-pmalani@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Stable-dep-of: 9a8aadc ("platform/chrome: cros_ec_typec: zero out stale pointers") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent b55ef85 commit 49c98b5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/platform/chrome/cros_ec_typec.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,10 @@ static int cros_typec_get_switch_handles(struct cros_typec_port *port,
156156
return 0;
157157

158158
role_sw_err:
159-
usb_role_switch_put(port->role_sw);
160-
ori_sw_err:
161159
typec_switch_put(port->ori_sw);
162-
mux_err:
160+
ori_sw_err:
163161
typec_mux_put(port->mux);
164-
162+
mux_err:
165163
return -ENODEV;
166164
}
167165

0 commit comments

Comments
 (0)