Skip to content

Commit 4914d67

Browse files
jhovoldvinodkoul
authored andcommitted
phy: ti: gmii-sel: fix regmap leak on probe failure
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: 5ab90f4 ("phy: ti: gmii-sel: Do not use syscon helper to build regmap") Cc: stable@vger.kernel.org # 6.14 Cc: Andrew Davis <afd@ti.com> Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Andrew Davis <afd@ti.com> Link: https://patch.msgid.link/20251127134834.2030-1-johan@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent d543d3e commit 4914d67

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/phy/ti/phy-gmii-sel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ static int phy_gmii_sel_probe(struct platform_device *pdev)
512512
return dev_err_probe(dev, PTR_ERR(base),
513513
"failed to get base memory resource\n");
514514

515-
priv->regmap = regmap_init_mmio(dev, base, &phy_gmii_sel_regmap_cfg);
515+
priv->regmap = devm_regmap_init_mmio(dev, base, &phy_gmii_sel_regmap_cfg);
516516
if (IS_ERR(priv->regmap))
517517
return dev_err_probe(dev, PTR_ERR(priv->regmap),
518518
"Failed to get syscon\n");

0 commit comments

Comments
 (0)