kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] ASoC: Intel: bxt-da7219-max98357a: return -EINVAL on unrecognized speaker amplifier
@ 2020-07-02 11:48 Colin King
  2020-07-02 14:40 ` [PATCH][next] ASoC: Intel: bxt-da7219-max98357a: return -EINVAL on unrecognized speaker amplifie Pierre-Louis Bossart
  2020-07-03 17:03 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2020-07-02 11:48 UTC (permalink / raw)
  To: Cezary Rojewski, Pierre-Louis Bossart, Liam Girdwood, Jie Yang,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Brent Lu, alsa-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: e1435a1feb18 ("ASoC: Intel: bxt-da7219-max98357a: support MAX98390 speaker amp")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 sound/soc/intel/boards/bxt_da7219_max98357a.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] ASoC: Intel: bxt-da7219-max98357a: return -EINVAL on unrecognized speaker amplifie
  2020-07-02 11:48 [PATCH][next] ASoC: Intel: bxt-da7219-max98357a: return -EINVAL on unrecognized speaker amplifier Colin King
@ 2020-07-02 14:40 ` Pierre-Louis Bossart
  2020-07-03 17:03 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Pierre-Louis Bossart @ 2020-07-02 14:40 UTC (permalink / raw)
  To: Colin King, Cezary Rojewski, Liam Girdwood, Jie Yang, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Brent Lu, alsa-devel
  Cc: kernel-janitors, linux-kernel



On 7/2/20 6:48 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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.
> 
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: e1435a1feb18 ("ASoC: Intel: bxt-da7219-max98357a: support MAX98390 speaker amp")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Sounds good, thanks Colin.

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

> ---
>   sound/soc/intel/boards/bxt_da7219_max98357a.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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);
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] ASoC: Intel: bxt-da7219-max98357a: return -EINVAL on unrecognized speaker amplifie
  2020-07-02 11:48 [PATCH][next] ASoC: Intel: bxt-da7219-max98357a: return -EINVAL on unrecognized speaker amplifier Colin King
  2020-07-02 14:40 ` [PATCH][next] ASoC: Intel: bxt-da7219-max98357a: return -EINVAL on unrecognized speaker amplifie Pierre-Louis Bossart
@ 2020-07-03 17:03 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-07-03 17:03 UTC (permalink / raw)
  To: Jaroslav Kysela, Liam Girdwood, Cezary Rojewski, Jie Yang,
	alsa-devel, Takashi Iwai, Colin King, Brent Lu,
	Pierre-Louis Bossart
  Cc: kernel-janitors, linux-kernel

On Thu, 2 Jul 2020 12:48:35 +0100, Colin King wrote:
> 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.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: Intel: bxt-da7219-max98357a: return -EINVAL on unrecognized speaker amplifier
      commit: c950e9fcc79b8fedd3126ede4dcd70add8ea5339

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-03 17:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02 11:48 [PATCH][next] ASoC: Intel: bxt-da7219-max98357a: return -EINVAL on unrecognized speaker amplifier Colin King
2020-07-02 14:40 ` [PATCH][next] ASoC: Intel: bxt-da7219-max98357a: return -EINVAL on unrecognized speaker amplifie Pierre-Louis Bossart
2020-07-03 17:03 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).