summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2024-01-25 10:31:13 +0000
committerMark Brown <broonie@kernel.org>2024-01-26 14:46:56 +0000
commita2e7cf55db781654fdb2d3b2529e28c4d93e24fc (patch)
tree5da953ab45d08866666dbd15a7c11f98e46a3e29 /sound/soc/codecs
parent40f6281c1e7d733399bd42fe97a0aae00b967a91 (diff)
downloadlinux-stable-a2e7cf55db781654fdb2d3b2529e28c4d93e24fc.tar.gz
linux-stable-a2e7cf55db781654fdb2d3b2529e28c4d93e24fc.tar.bz2
linux-stable-a2e7cf55db781654fdb2d3b2529e28c4d93e24fc.zip
ASoC: cs42l43: Check error from device_property_read_u32_array()
Whilst reading cirrus,buttons-ohms the error from device_property_read_u32_array() is not checked, whilst there is a preceding device_property_count_u32() which is checked the property read can still fail. Add the missing check. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://msgid.link/r/20240125103117.2622095-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/cs42l43-jack.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/codecs/cs42l43-jack.c b/sound/soc/codecs/cs42l43-jack.c
index 4f7a405b7e06..67ccdc8bab6f 100644
--- a/sound/soc/codecs/cs42l43-jack.c
+++ b/sound/soc/codecs/cs42l43-jack.c
@@ -106,8 +106,13 @@ int cs42l43_set_jack(struct snd_soc_component *component,
goto error;
}
- device_property_read_u32_array(cs42l43->dev, "cirrus,buttons-ohms",
- priv->buttons, ret);
+ ret = device_property_read_u32_array(cs42l43->dev, "cirrus,buttons-ohms",
+ priv->buttons, ret);
+ if (ret < 0) {
+ dev_err(priv->dev, "Property cirrus,button-ohms malformed: %d\n",
+ ret);
+ goto error;
+ }
} else {
priv->buttons[0] = 70;
priv->buttons[1] = 185;