public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] platform/chrome: cros_ec_typec: Put fwnode in error case during ->probe()
@ 2021-06-14 20:33 Andy Shevchenko
  2021-06-14 21:33 ` Prashant Malani
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2021-06-14 20:33 UTC (permalink / raw)
  To: Prashant Malani, linux-kernel
  Cc: Benson Leung, Enric Balletbo i Serra, Guenter Roeck,
	Andy Shevchenko

device_for_each_child_node() bumps a reference counting of a returned variable.
We have to balance it whenever we return to the caller.

Fixes: fdc6b21e2444 ("platform/chrome: Add Type C connector class driver")
Cc: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/platform/chrome/cros_ec_typec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
index 27c068c4c38d..fb03c22fa34d 100644
--- a/drivers/platform/chrome/cros_ec_typec.c
+++ b/drivers/platform/chrome/cros_ec_typec.c
@@ -375,6 +375,7 @@ static int cros_typec_init_ports(struct cros_typec_data *typec)
 	return 0;
 
 unregister_ports:
+	fwnode_handle_put(fwnode);
 	cros_unregister_ports(typec);
 	return ret;
 }
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-14 21:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-14 20:33 [PATCH v1 1/1] platform/chrome: cros_ec_typec: Put fwnode in error case during ->probe() Andy Shevchenko
2021-06-14 21:33 ` Prashant Malani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox