summaryrefslogtreecommitdiff
path: root/sound/soc/sti/uniperif_reader.c
diff options
context:
space:
mode:
authorArnaud Pouliquen <arnaud.pouliquen@st.com>2015-09-10 10:45:55 +0300
committerMark Brown <broonie@kernel.org>2015-09-10 13:11:18 +0300
commit3a0e27d84bb9abac5e39dc71706768a88c72cb71 (patch)
tree7c881821d53c702ae17bd1c1472686b2e226c307 /sound/soc/sti/uniperif_reader.c
parent91931320cfbbcc1dd874c2d0aef62e7d90f07f70 (diff)
downloadlinux-3a0e27d84bb9abac5e39dc71706768a88c72cb71.tar.xz
ASoC: sti: check return of of_property_read
Add check on of_property_read to return error when DT required property is not defined. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sti/uniperif_reader.c')
-rw-r--r--sound/soc/sti/uniperif_reader.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/sti/uniperif_reader.c b/sound/soc/sti/uniperif_reader.c
index c502626f339b..f791239a3087 100644
--- a/sound/soc/sti/uniperif_reader.c
+++ b/sound/soc/sti/uniperif_reader.c
@@ -316,7 +316,11 @@ static int uni_reader_parse_dt(struct platform_device *pdev,
if (!info)
return -ENOMEM;
- of_property_read_u32(node, "version", &reader->ver);
+ if (of_property_read_u32(node, "version", &reader->ver) ||
+ reader->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
+ dev_err(&pdev->dev, "Unknown uniperipheral version ");
+ return -EINVAL;
+ }
/* Save the info structure */
reader->info = info;