usb: typec: tipd: Cleanup resources if devm_tps6598_psy_register fails

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: 10eb0b6ac6 ("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>
This commit is contained in:
Sven Peter 2022-11-14 18:44:46 +01:00 committed by Greg Kroah-Hartman
parent e99e1a7d6f
commit 19c220e9ab
1 changed files with 1 additions and 1 deletions

View File

@ -814,7 +814,7 @@ static int tps6598x_probe(struct i2c_client *client)
ret = devm_tps6598_psy_register(tps); ret = devm_tps6598_psy_register(tps);
if (ret) if (ret)
return ret; goto err_role_put;
tps->port = typec_register_port(&client->dev, &typec_cap); tps->port = typec_register_port(&client->dev, &typec_cap);
if (IS_ERR(tps->port)) { if (IS_ERR(tps->port)) {