diff options
author | Colin Ian King <colin.king@canonical.com> | 2020-07-02 12:48:35 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-07-02 17:18:50 +0100 |
commit | c950e9fcc79b8fedd3126ede4dcd70add8ea5339 (patch) | |
tree | 13dbd15bacc983108fb477680d718901d89be77f /sound/soc/intel/boards/bxt_da7219_max98357a.c | |
parent | c8e22990d2e962f398207d94a2f1c493f4fa6713 (diff) | |
download | linux-c950e9fcc79b8fedd3126ede4dcd70add8ea5339.tar.bz2 |
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>
Diffstat (limited to 'sound/soc/intel/boards/bxt_da7219_max98357a.c')
-rw-r--r-- | sound/soc/intel/boards/bxt_da7219_max98357a.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c index 4d39253e796b..0c0a717823c4 100644 --- a/sound/soc/intel/boards/bxt_da7219_max98357a.c +++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c @@ -677,7 +677,7 @@ static int bxt_card_late_probe(struct snd_soc_card *card) break; default: 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); |