Re: [PATCH RESEND] net: stmmac: drop the runtime PM reference on probe failure

From: Krzysztof Kozlowski

Date: Tue Nov 03 2026 - 07:54:49 EST


On 03/11/2026 11:29, Wentao Liang wrote:
> __stmmac_dvr_probe() takes a runtime PM reference with
> pm_runtime_get_noresume() and enables runtime PM before registering the
> MDIO bus. The reference is only dropped on the success path, so a
> failure of the MDIO, PCS, phylink, devlink or netdev registration leaves
> the usage counter elevated. The device is never bound in that case, so
> stmmac_dvr_remove() never runs to release it.
>
> Drop the reference and disable runtime PM again on the common error path.
> Only disable runtime PM if this driver enabled it, because PCI devices
> already have it enabled by the PCI core.
>
> Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex

Implement comments you received, instead of resending.

Best regards,
Krzysztof