diff options
| author | Javier Carrasco <javier.carrasco.cruz@gmail.com> | 2024-10-13 15:20:24 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-14 19:54:02 +0100 |
| commit | d427e3aa8486b7e95fb562ae7619a3db9d3286b1 (patch) | |
| tree | 84c495a081c542c7acba11f4b002e516f4986129 /drivers/platform | |
| parent | 082dc185b8619c6ec8d05ed58e36c4a5c9b315ba (diff) | |
| download | linux-d427e3aa8486b7e95fb562ae7619a3db9d3286b1.tar.gz linux-d427e3aa8486b7e95fb562ae7619a3db9d3286b1.tar.bz2 linux-d427e3aa8486b7e95fb562ae7619a3db9d3286b1.zip | |
platform/chrome: cros_ec_typec: fix missing fwnode reference decrement
commit 9c41f371457bd9a24874e3c7934d9745e87fbc58 upstream.
The device_for_each_child_node() macro requires explicit calls to
fwnode_handle_put() upon early exits (return, break, goto) to decrement
the fwnode's refcount, and avoid levaing a node reference behind.
Add the missing fwnode_handle_put() after the common label for all error
paths.
Cc: stable@vger.kernel.org
Fixes: fdc6b21e2444 ("platform/chrome: Add Type C connector class driver")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241013-cross_ec_typec_fwnode_handle_put-v2-1-9182b2cd7767@gmail.com
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/platform')
| -rw-r--r-- | drivers/platform/chrome/cros_ec_typec.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c index a74d01e9089e..51b98f6c7b39 100644 --- a/drivers/platform/chrome/cros_ec_typec.c +++ b/drivers/platform/chrome/cros_ec_typec.c @@ -446,6 +446,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; } |
