Skip to content

Commit

Permalink
ASoC: acpi: fix: continue searching when machine is ignored
Browse files Browse the repository at this point in the history
The machine_quirk may return NULL which means the acpi entries should be
skipped and search for next matched entry is needed, here add return
check here and continue for NULL case.

Signed-off-by: Keyon Jie <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
keyonjie authored and broonie committed Nov 20, 2018
1 parent 8c4e7c2 commit a3e620f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sound/soc/soc-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ struct snd_soc_acpi_mach *
snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines)
{
struct snd_soc_acpi_mach *mach;
struct snd_soc_acpi_mach *mach_alt;

for (mach = machines; mach->id[0]; mach++) {
if (acpi_dev_present(mach->id, NULL, -1)) {
if (mach->machine_quirk)
mach = mach->machine_quirk(mach);
if (mach->machine_quirk) {
mach_alt = mach->machine_quirk(mach);
if (!mach_alt)
continue; /* not full match, ignore */
mach = mach_alt;
}

return mach;
}
}
Expand Down

0 comments on commit a3e620f

Please sign in to comment.