diff mbox series

ASoC: SOF: Intel: fix hda_sdw_check_wakeen_irq()

Message ID 20230814074711.1068093-1-arnd@kernel.org
State New
Headers show
Series ASoC: SOF: Intel: fix hda_sdw_check_wakeen_irq() | expand

Commit Message

Arnd Bergmann Aug. 14, 2023, 7:46 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

This function cannot work, as the 'chip' variable is never initialized:

sound/soc/sof/intel/hda.c:423:6: error: variable 'chip' is uninitialized when used here [-Werror,-Wuninitialized]
        if (chip && chip->check_sdw_wakeen_irq)
            ^~~~

Set it the same way that other functions in this file do.

Fixes: 9362ab78f175d ("ASoC: SOF: Intel: add abstraction for SoundWire wake-ups")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
There hasn't been a new linux-next in a few days, so there is a good chance
someone else already fixed this in the meantime. Sending out my fix in case
that hasn't happened yet.
---
 sound/soc/sof/intel/hda.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pierre-Louis Bossart Aug. 14, 2023, 1:55 p.m. UTC | #1
On 8/14/23 02:46, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> This function cannot work, as the 'chip' variable is never initialized:
> 
> sound/soc/sof/intel/hda.c:423:6: error: variable 'chip' is uninitialized when used here [-Werror,-Wuninitialized]
>         if (chip && chip->check_sdw_wakeen_irq)
>             ^~~~
> 
> Set it the same way that other functions in this file do.
> 
> Fixes: 9362ab78f175d ("ASoC: SOF: Intel: add abstraction for SoundWire wake-ups")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> There hasn't been a new linux-next in a few days, so there is a good chance
> someone else already fixed this in the meantime. Sending out my fix in case
> that hasn't happened yet.

yes it was found by Nathan Chancelor and corrected already. Thanks for
checking though!


> ---
>  sound/soc/sof/intel/hda.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
> index 04c748a72b137..6c9c7b390cf53 100644
> --- a/sound/soc/sof/intel/hda.c
> +++ b/sound/soc/sof/intel/hda.c
> @@ -415,7 +415,7 @@ bool hda_sdw_check_wakeen_irq_common(struct snd_sof_dev *sdev)
>  static bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev)
>  {
>  	u32 interface_mask = hda_get_interface_mask(sdev);
> -	const struct sof_intel_dsp_desc *chip;
> +	const struct sof_intel_dsp_desc *chip = get_chip_info(sdev->pdata);
>  
>  	if (!(interface_mask & BIT(SOF_DAI_INTEL_ALH)))
>  		return false;
diff mbox series

Patch

diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 04c748a72b137..6c9c7b390cf53 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -415,7 +415,7 @@  bool hda_sdw_check_wakeen_irq_common(struct snd_sof_dev *sdev)
 static bool hda_sdw_check_wakeen_irq(struct snd_sof_dev *sdev)
 {
 	u32 interface_mask = hda_get_interface_mask(sdev);
-	const struct sof_intel_dsp_desc *chip;
+	const struct sof_intel_dsp_desc *chip = get_chip_info(sdev->pdata);
 
 	if (!(interface_mask & BIT(SOF_DAI_INTEL_ALH)))
 		return false;