mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 07:50:04 +00:00
ASoC: Intel: bxt-da7219-max98357a: return -EINVAL on unrecognized speaker amplifier
Currently if the ctx->spkamp is not recognized an error message is reported but the code continues to set up the device with uninitialized variables such as the number of widgets. Fix this by returning -EINVAL for unrecognized speaker amplifier types. Fixes: e1435a1feb18 ("ASoC: Intel: bxt-da7219-max98357a: support MAX98390 speaker amp") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Addresses-Coverity: ("Uninitialized scalar variable") Link: https://lore.kernel.org/r/20200702114835.37889-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
c8e22990d2
commit
c950e9fcc7
@ -677,7 +677,7 @@ static int bxt_card_late_probe(struct snd_soc_card *card)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dev_err(card->dev, "Invalid speaker amplifier %d\n", ctx->spkamp);
|
dev_err(card->dev, "Invalid speaker amplifier %d\n", ctx->spkamp);
|
||||||
break;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = snd_soc_dapm_new_controls(&card->dapm, widgets, num_widgets);
|
err = snd_soc_dapm_new_controls(&card->dapm, widgets, num_widgets);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user