aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorRichard Zhao <richard.zhao@freescale.com>2012-04-24 15:24:43 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-12 09:32:04 -0700
commit35cdf78c44dc54a6262ebbfc745f46bd3b813f94 (patch)
tree3fae459d3506f3758928bfa5347188591a141be0 /sound
parente7bcb4bafa9bb05db987601067c2f9da45d2678c (diff)
ASoC: core: check of_property_count_strings failure
commit c34ce320d9fe328e3272def20b152f39ccfa045e upstream. Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 92cee24ed2d..48e91cd0d34 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3420,10 +3420,10 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
int i, ret;
num_routes = of_property_count_strings(np, propname);
- if (num_routes & 1) {
+ if (num_routes < 0 || num_routes & 1) {
dev_err(card->dev,
- "Property '%s's length is not even\n",
- propname);
+ "Property '%s' does not exist or its length is not even\n",
+ propname);
return -EINVAL;
}
num_routes /= 2;