diff options
author | Richard Zhao <richard.zhao@freescale.com> | 2012-04-24 15:24:43 +0800 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2012-05-14 19:06:46 +0530 |
commit | 3c123c1fa98276c41e28073ccbd01a24a44833f2 (patch) | |
tree | 0ef4373c2940d352a1cfaaac03e950e3db946cdb /sound | |
parent | 69dbeed94e08bc45f21ca25ee8af8225f0b51b60 (diff) |
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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 1d6a80c9f4c2..c88d9741b9e7 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3625,10 +3625,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; |