Skip to content

Commit

Permalink
ASoC: core: check of_property_count_strings failure
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Zhao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Cc: [email protected]
  • Loading branch information
Richard Zhao authored and broonie committed Apr 24, 2012
1 parent ddb6706 commit c34ce32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3631,10 +3631,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;
Expand Down

0 comments on commit c34ce32

Please sign in to comment.