Skip to content

Commit c34ce32

Browse files
Richard Zhaobroonie
authored andcommitted
ASoC: core: check of_property_count_strings failure
Signed-off-by: Richard Zhao <[email protected]> Signed-off-by: Mark Brown <[email protected]> Cc: [email protected]
1 parent ddb6706 commit c34ce32

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound/soc/soc-core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3631,10 +3631,10 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
36313631
int i, ret;
36323632

36333633
num_routes = of_property_count_strings(np, propname);
3634-
if (num_routes & 1) {
3634+
if (num_routes < 0 || num_routes & 1) {
36353635
dev_err(card->dev,
3636-
"Property '%s's length is not even\n",
3637-
propname);
3636+
"Property '%s' does not exist or its length is not even\n",
3637+
propname);
36383638
return -EINVAL;
36393639
}
36403640
num_routes /= 2;

0 commit comments

Comments
 (0)