Re: [PATCH] soc: mediatek: SVS: fix device reference leak in svs_add_device_link()

From: AngeloGioacchino Del Regno

Date: Tue Nov 17 2026 - 05:48:32 EST


On Fri, 23 Oct 2026 16:29:48 +0800, Coia Prant wrote:
> svs_add_device_link() calls svs_get_subsys_device(), which returns a
> device with a reference taken by of_find_device_by_node(). If either of
> the subsequent checks fails, the function returns an error pointer
> without dropping that reference, and the caller only checks IS_ERR() and
> bails out, so the reference is leaked on every -EPROBE_DEFER.
>
> Both error paths can be hit in practice: device_link_add() returns NULL
> when the link would create a reverse dependency or on allocation
> failure, and the supplier status check fails whenever the supplier has
> not bound yet.
>
> [...]

Applied to v7.4-next/soc, thanks!

[1/1] soc: mediatek: SVS: fix device reference leak in svs_add_device_link()
commit: 8ba2b21adad087d7dd2fd8b12877ead8b982e694

Cheers,
Angelo