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

AngeloGioacchino Del Regno angelogioacchino.delregno at collabora.com
Tue Nov 17 02:48:06 PST 2026


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




More information about the Linux-mediatek mailing list