From 35cdf78c44dc54a6262ebbfc745f46bd3b813f94 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Tue, 24 Apr 2012 15:24:43 +0800 Subject: ASoC: core: check of_property_count_strings failure commit c34ce320d9fe328e3272def20b152f39ccfa045e upstream. Signed-off-by: Richard Zhao Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-core.c | 6 +++--- 1 file 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; -- cgit v1.2.3-18-g5258