]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: core: check of_property_count_strings failure
authorRichard Zhao <richard.zhao@freescale.com>
Tue, 24 Apr 2012 07:24:43 +0000 (15:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 May 2012 16:32:04 +0000 (09:32 -0700)
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>
sound/soc/soc-core.c

index 92cee24ed2dcce7eb7b7e8de3a87f09d0ffe5138..48e91cd0d34cff96896a33d9c70cfad80a9e9f07 100644 (file)
@@ -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;