[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3ae82d10-a9d6-4ef9-91dd-4d0f6de56089@ti.com>
Date: Mon, 1 Dec 2025 12:02:19 -0600
From: Andrew Davis <afd@...com>
To: Johan Hovold <johan@...nel.org>, Vinod Koul <vkoul@...nel.org>, "Kishon
Vijay Abraham I" <kishon@...nel.org>
CC: <linux-phy@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
<stable@...r.kernel.org>
Subject: Re: [PATCH] phy: ti: gmii-sel: fix regmap leak on probe failure
On 11/27/25 7:48 AM, Johan Hovold wrote:
> The mmio regmap that may be allocated during probe is never freed.
>
> Switch to using the device managed allocator so that the regmap is
> released on probe failures (e.g. probe deferral) and on driver unbind.
>
> Fixes: 5ab90f40121a ("phy: ti: gmii-sel: Do not use syscon helper to build regmap")
> Cc: stable@...r.kernel.org # 6.14
> Cc: Andrew Davis <afd@...com>
> Signed-off-by: Johan Hovold <johan@...nel.org>
> ---
Acked-by: Andrew Davis <afd@...com>
> drivers/phy/ti/phy-gmii-sel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c
> index 50adabb867cb..26209a89703a 100644
> --- a/drivers/phy/ti/phy-gmii-sel.c
> +++ b/drivers/phy/ti/phy-gmii-sel.c
> @@ -512,7 +512,7 @@ static int phy_gmii_sel_probe(struct platform_device *pdev)
> return dev_err_probe(dev, PTR_ERR(base),
> "failed to get base memory resource\n");
>
> - priv->regmap = regmap_init_mmio(dev, base, &phy_gmii_sel_regmap_cfg);
> + priv->regmap = devm_regmap_init_mmio(dev, base, &phy_gmii_sel_regmap_cfg);
> if (IS_ERR(priv->regmap))
> return dev_err_probe(dev, PTR_ERR(priv->regmap),
> "Failed to get syscon\n");
Powered by blists - more mailing lists