mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 10:46:33 +00:00
ASoC: core: check of_property_count_strings failure
commit c34ce320d9fe328e3272def20b152f39ccfa045e upstream. Signed-off-by: Richard Zhao <richard.zhao@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e7bcb4bafa
commit
35cdf78c44
@ -3420,10 +3420,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user