mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-21 11:44:01 +08:00
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
This commit is contained in:
parent
ddb6706af3
commit
c34ce320d9
@ -3631,9 +3631,9 @@ 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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user