Skip to content

Commit 1696fad

Browse files
svanheulebroonie
authored andcommitted
ASoC: sti: use managed regmap_field allocations
The regmap_field objects allocated at player init are never freed and may leak resources if the driver is removed. Switch to devm_regmap_field_alloc() to automatically limit the lifetime of the allocations the lifetime of the device. Fixes: 76c2145 ("ASoC: sti: Add CPU DAI driver for playback") Signed-off-by: Sander Vanheule <sander@svanheule.net> Link: https://patch.msgid.link/20260220152634.480766-3-sander@svanheule.net Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 272aabe commit 1696fad

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/soc/sti/uniperif_player.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,11 +1028,11 @@ static int uni_player_parse_dt_audio_glue(struct platform_device *pdev,
10281028
return PTR_ERR(regmap);
10291029
}
10301030

1031-
player->clk_sel = regmap_field_alloc(regmap, regfield[0]);
1031+
player->clk_sel = devm_regmap_field_alloc(&pdev->dev, regmap, regfield[0]);
10321032
if (IS_ERR(player->clk_sel))
10331033
return PTR_ERR(player->clk_sel);
10341034

1035-
player->valid_sel = regmap_field_alloc(regmap, regfield[1]);
1035+
player->valid_sel = devm_regmap_field_alloc(&pdev->dev, regmap, regfield[1]);
10361036
if (IS_ERR(player->valid_sel))
10371037
return PTR_ERR(player->valid_sel);
10381038

0 commit comments

Comments
 (0)