]> www.infradead.org Git - users/jedix/linux-maple.git/commit
platform/chrome: cros_ec_typec: fix missing fwnode reference decrement
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Sun, 13 Oct 2024 13:20:24 +0000 (15:20 +0200)
committerTzung-Bi Shih <tzungbi@kernel.org>
Mon, 14 Oct 2024 03:32:52 +0000 (03:32 +0000)
commit9c41f371457bd9a24874e3c7934d9745e87fbc58
treeb0d3817bdb5ddb68b290645389f5eb246b95a46d
parent7cbf28998d737e04c4872cfeedd1a546d22cfb44
platform/chrome: cros_ec_typec: fix missing fwnode reference decrement

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>
drivers/platform/chrome/cros_ec_typec.c