diff mbox series

[1/4] usb: typec: tipd: Cleanup resources if devm_tps6598_psy_register fails

Message ID 20221114174449.34634-1-sven@svenpeter.dev
State New
Headers show
Series [1/4] usb: typec: tipd: Cleanup resources if devm_tps6598_psy_register fails | expand

Commit Message

Sven Peter Nov. 14, 2022, 5:44 p.m. UTC
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: 10eb0b6ac63a ("usb: typec: tps6598x: Export some power supply properties")
Signed-off-by: Sven Peter <sven@svenpeter.dev>
---
 drivers/usb/typec/tipd/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
index 748ff4f6b5f6..ebc786d728e2 100644
--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -827,7 +827,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)) {