ASoC: codecs: Check for error pointer after calling devm_regmap_init_mmio
Subsystems (3)
PATCH v2 1/1 ASoC: codecs: Check for error pointer after calling devm_regmap_init_mmio
Since the possible failure of the devm_regmap_init_mmio(), it will return error pointer and be assigned to the regmap. Then the error pointer will be dereferenced.
For example rx->regmap will be used in rx_macro_mclk_enable(). Therefore, it should be better to check it.
---
Changelog
v1 -> v2
* Change 1. Refine the commit message.
--- sound/soc/codecs/lpass-rx-macro.c | 2 ++ sound/soc/codecs/lpass-tx-macro.c | 2 ++ sound/soc/codecs/lpass-wsa-macro.c | 2 ++ 3 files changed, 6 insertions(+)
sound/soc/codecs/lpass-rx-macro.c +2 -0
@@ -3542,6 +3542,8 @@ static int rx_macro_probe(struct platform_device *pdev)return PTR_ERR (base); rx->regmap =devm_regmap_init_mmio (dev, base, &rx_regmap_config); +if (IS_ERR (rx->regmap)) +return PTR_ERR (rx->regmap);dev_set_drvdata (dev, rx);
sound/soc/codecs/lpass-tx-macro.c +2 -0
@@ -1803,6 +1803,8 @@ static int tx_macro_probe(struct platform_device *pdev)return PTR_ERR (base); tx->regmap =devm_regmap_init_mmio (dev, base, &tx_regmap_config); +if (IS_ERR (tx->regmap)) +return PTR_ERR (tx->regmap);dev_set_drvdata (dev, tx);
sound/soc/codecs/lpass-wsa-macro.c +2 -0
@@ -2405,6 +2405,8 @@ static int wsa_macro_probe(struct platform_device *pdev)return PTR_ERR (base); wsa->regmap =devm_regmap_init_mmio (dev, base, &wsa_regmap_config); +if (IS_ERR (wsa->regmap)) +return PTR_ERR (wsa->regmap);dev_set_drvdata (dev, wsa);
Signature · 1 line
2.25.1
Mark Brown
maintainerQuoted 5 lines · Jiasheng Jiang
Since the possible failure of the
devm_regmap_init_mmio(), it will return error pointer and be assigned to the regmap. Then the error pointer will be dereferenced.
For examplerx->regmapwill be used inrx_macro_mclk_enable(). Therefore, it should be better to check it.
This doesn't apply against current code, please check and resend.
Mark Brown
maintainerQuoted 8 lines · Jiasheng Jiang
Since the possible failure of the
devm_regmap_init_mmio(), it will return error pointer and be assigned to the regmap. Then the error pointer will be dereferenced.
For examplerx->regmapwill be used inrx_macro_mclk_enable(). Therefore, it should be better to check it.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: codecs: Check for error pointer after calling devm_regmap_init_mmio
commit: aa505ecccf2ae7546e0e262d574e18a9241f3005
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark