diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2023-07-31 16:37:48 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-07-31 23:22:18 +0100 |
commit | 871861f6ad6d43b49caade3f42b9d40ca1413e79 (patch) | |
tree | b179d8168e7e562c8748a9d72fcd8cfe09366ac1 /sound/soc | |
parent | 71d76768fbe72aa70dd61d5714a5579dc4ca61cb (diff) | |
download | linux-stable-871861f6ad6d43b49caade3f42b9d40ca1413e79.tar.gz linux-stable-871861f6ad6d43b49caade3f42b9d40ca1413e79.tar.bz2 linux-stable-871861f6ad6d43b49caade3f42b9d40ca1413e79.zip |
ASoC: amd: acp5x-mach:add checks to avoid static analysis warnings
snd_soc_card_get_codec_dai() can return NULL, but that value is not
checked for, leading to static analysis warnings.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Yaochun Hung <yc.hung@mediatek.com>
Link: https://lore.kernel.org/r/20230731213748.440285-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/amd/vangogh/acp5x-mach.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/amd/vangogh/acp5x-mach.c b/sound/soc/amd/vangogh/acp5x-mach.c index 125a8e93478d..eda464545866 100644 --- a/sound/soc/amd/vangogh/acp5x-mach.c +++ b/sound/soc/amd/vangogh/acp5x-mach.c @@ -170,6 +170,9 @@ static int acp5x_nau8821_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai = snd_soc_card_get_codec_dai(card, ACP5X_NAU8821_DAI_NAME); int ret, bclk; + if (!dai) + return -EINVAL; + ret = snd_soc_dai_set_sysclk(dai, NAU8821_CLK_FLL_BLK, 0, SND_SOC_CLOCK_IN); if (ret < 0) dev_err(card->dev, "can't set FS clock %d\n", ret); |