alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: cs35l56: Avoid static analysis warning of uninitialised variable
@ 2024-04-22 10:32 Richard Fitzgerald
  2024-04-23  5:04 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2024-04-22 10:32 UTC (permalink / raw)
  To: broonie
  Cc: linux-kernel, patches, alsa-devel, linux-sound, Simon Trimmer,
	Richard Fitzgerald

From: Simon Trimmer <simont@opensource.cirrus.com>

Static checkers complain that the silicon_uid variable passed by
pointer to cs35l56_read_silicon_uid() could later be used
uninitialised when calling cs_amp_get_efi_calibration_data().

cs35l56_read_silicon_uid() must have succeeded to call
cs_amp_get_efi_calibration_data() and that would have populated the
variable.

However, initialise the value so we are not haunted by it forevermore.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Fixes: e1830f66f6c6 ("ASoC: cs35l56: Add helper functions for amp calibration")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 sound/soc/codecs/cs35l56-shared.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-shared.c
index 3aa39f5923eb..8af89a263594 100644
--- a/sound/soc/codecs/cs35l56-shared.c
+++ b/sound/soc/codecs/cs35l56-shared.c
@@ -707,7 +707,7 @@ EXPORT_SYMBOL_NS_GPL(cs35l56_calibration_controls, SND_SOC_CS35L56_SHARED);
 
 int cs35l56_get_calibration(struct cs35l56_base *cs35l56_base)
 {
-	u64 silicon_uid;
+	u64 silicon_uid = 0;
 	int ret;
 
 	/* Driver can't apply calibration to a secured part, so skip */
-- 
2.39.2


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

* Re: [PATCH] ASoC: cs35l56: Avoid static analysis warning of uninitialised variable
  2024-04-22 10:32 [PATCH] ASoC: cs35l56: Avoid static analysis warning of uninitialised variable Richard Fitzgerald
@ 2024-04-23  5:04 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2024-04-23  5:04 UTC (permalink / raw)
  To: Richard Fitzgerald
  Cc: linux-kernel, patches, alsa-devel, linux-sound, Simon Trimmer

On Mon, 22 Apr 2024 11:32:11 +0100, Richard Fitzgerald wrote:
> Static checkers complain that the silicon_uid variable passed by
> pointer to cs35l56_read_silicon_uid() could later be used
> uninitialised when calling cs_amp_get_efi_calibration_data().
> 
> cs35l56_read_silicon_uid() must have succeeded to call
> cs_amp_get_efi_calibration_data() and that would have populated the
> variable.
> 
> [...]

Applied to

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

Thanks!

[1/1] ASoC: cs35l56: Avoid static analysis warning of uninitialised variable
      commit: f2602fba4723e408380eb9a56e921d36a1ae21f8

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] 2+ messages in thread

end of thread, other threads:[~2024-04-23  5:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-22 10:32 [PATCH] ASoC: cs35l56: Avoid static analysis warning of uninitialised variable Richard Fitzgerald
2024-04-23  5:04 ` 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).