Skip to content

Commit

Permalink
usb: typec: tipd: Cleanup resources if devm_tps6598_psy_register fails
Browse files Browse the repository at this point in the history
[ Upstream commit 19c220e ]

We can't just return if devm_tps6598_psy_register fails since previous
resources are not devres managed and have yet to be cleaned up.

Fixes: 10eb0b6 ("usb: typec: tps6598x: Export some power supply properties")
Signed-off-by: Sven Peter <sven@svenpeter.dev>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20221114174449.34634-1-sven@svenpeter.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
svenpeter42 authored and gregkh committed Dec 31, 2022
1 parent ba75be6 commit b0d86ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/typec/tipd/core.c
Expand Up @@ -684,7 +684,7 @@ static int tps6598x_probe(struct i2c_client *client)

ret = devm_tps6598_psy_register(tps);
if (ret)
return ret;
goto err_role_put;

tps->port = typec_register_port(&client->dev, &typec_cap);
if (IS_ERR(tps->port)) {
Expand Down

0 comments on commit b0d86ea

Please sign in to comment.