Commit c34ce320 authored by Richard Zhao's avatar Richard Zhao Committed by Mark Brown

ASoC: core: check of_property_count_strings failure

Signed-off-by: default avatarRichard Zhao <richard.zhao@freescale.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
parent ddb6706a
...@@ -3631,10 +3631,10 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, ...@@ -3631,10 +3631,10 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
int i, ret; int i, ret;
num_routes = of_property_count_strings(np, propname); num_routes = of_property_count_strings(np, propname);
if (num_routes & 1) { if (num_routes < 0 || num_routes & 1) {
dev_err(card->dev, dev_err(card->dev,
"Property '%s's length is not even\n", "Property '%s' does not exist or its length is not even\n",
propname); propname);
return -EINVAL; return -EINVAL;
} }
num_routes /= 2; num_routes /= 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment