mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
ASoC: codecs: wcd939x: fix regmap leak on probe failure
The soundwire regmap that may be allocated during probe is not freed on
late probe failures.
Add the missing error handling.
Fixes: be2af391ce ("ASoC: codecs: Add WCD939x Soundwire devices driver")
Cc: stable@vger.kernel.org # 6.9
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20251127135057.2216-1-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
6797540c8b
commit
86dc090f73
|
|
@ -1400,12 +1400,18 @@ static int wcd9390_probe(struct sdw_slave *pdev, const struct sdw_device_id *id)
|
|||
|
||||
ret = component_add(dev, &wcd_sdw_component_ops);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_free_regmap;
|
||||
|
||||
/* Set suspended until aggregate device is bind */
|
||||
pm_runtime_set_suspended(dev);
|
||||
|
||||
return 0;
|
||||
|
||||
err_free_regmap:
|
||||
if (wcd->regmap)
|
||||
regmap_exit(wcd->regmap);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int wcd9390_remove(struct sdw_slave *pdev)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user