diff options
author | Richard Zhao <richard.zhao@freescale.com> | 2012-04-24 03:24:43 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-24 07:06:27 -0400 |
commit | c34ce320d9fe328e3272def20b152f39ccfa045e (patch) | |
tree | 1c6a22b63fdc18514fe399ca60a7a6a6be3804c9 /sound | |
parent | ddb6706af3cd372194cecd2cc61950519df620d7 (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 3a4e93e52b6d..b390f00b4e99 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, | |||
3631 | int i, ret; | 3631 | int i, ret; |
3632 | 3632 | ||
3633 | num_routes = of_property_count_strings(np, propname); | 3633 | num_routes = of_property_count_strings(np, propname); |
3634 | if (num_routes & 1) { | 3634 | if (num_routes < 0 || num_routes & 1) { |
3635 | dev_err(card->dev, | 3635 | dev_err(card->dev, |
3636 | "Property '%s's length is not even\n", | 3636 | "Property '%s' does not exist or its length is not even\n", |
3637 | propname); | 3637 | propname); |
3638 | return -EINVAL; | 3638 | return -EINVAL; |
3639 | } | 3639 | } |
3640 | num_routes /= 2; | 3640 | num_routes /= 2; |