Re: (subset) [PATCH v3] mfd: cros_ec: Drop OF node reference in ec_device_probe()
From: Lee Jones
Date: Tue Dec 01 2026 - 09:14:32 EST
On Mon, 23 Nov 2026 10:50:22 +0800, Xiangwu Lai wrote:
> ec_device_probe() calls of_find_compatible_node() only to check
> whether a "google,cros-ec-ucsi" node exists in the device tree, but
> the reference held by the returned node is never dropped.
>
> Scope the lookup to the UCSI block and mark the node pointer with
> __free(device_node), so that the reference is released automatically
> when the block is left. Keeping the lookup inside the block also
> preserves the short-circuit evaluation of the original condition:
> the device tree is only walked when the EC_FEATURE_USB_PD,
> EC_FEATURE_UCSI_PPM and ACPI checks already passed, instead of on
> every probe of every cros_ec device.
>
> [...]
Applied, thanks!
[1/1] mfd: cros_ec: Drop OF node reference in ec_device_probe()
https://git.kernel.org/lee/mfd/c/b6bded8b8625
--
Lee Jones [李琼斯]