summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorRichard Zhao <richard.zhao@freescale.com>2012-04-24 15:24:43 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-24 12:06:27 +0100
commitc34ce320d9fe328e3272def20b152f39ccfa045e (patch)
tree1c6a22b63fdc18514fe399ca60a7a6a6be3804c9 /sound
parentddb6706af3cd372194cecd2cc61950519df620d7 (diff)
downloadlinux-3.10-c34ce320d9fe328e3272def20b152f39ccfa045e.tar.gz
linux-3.10-c34ce320d9fe328e3272def20b152f39ccfa045e.tar.bz2
linux-3.10-c34ce320d9fe328e3272def20b152f39ccfa045e.zip
ASoC: core: check of_property_count_strings failure
Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.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 3a4e93e52b6..b390f00b4e9 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3631,10 +3631,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;