Skip to content

Commit

Permalink
ASoC: SOF: ipc4-topology: Fix use of unitialized value
Browse files Browse the repository at this point in the history
Initialize ref_params to zero in order to fix static analyzer
error:

ipc4-topology.c: In function ‘sof_ipc4_prepare_copier_module’:
ipc4-topology.c:1810:34: error: use of uninitialized value
‘((int *)<unknown>)[2]’ [CWE-457] [-Werror=analyzer-use-of-uninitialized-value]
struct snd_pcm_hw_params ref_params;

Note that this is a false positive, as manually inspecting the code there
is no path where ref_params is used unitialized.

Fixes: f920964 ("ASoC: SOF: ipc4-topology: Correct DAI copier config and NHLT blob request")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
  • Loading branch information
dbaluta committed Feb 3, 2025
1 parent 19a622d commit 4d5d2fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/sof/ipc4-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
struct sof_ipc4_copier_data *copier_data;
int input_fmt_index, output_fmt_index;
struct snd_pcm_hw_params ref_params;
struct snd_pcm_hw_params ref_params = { 0 };
struct sof_ipc4_copier *ipc4_copier;
struct snd_sof_dai *dai;
u32 gtw_cfg_config_length;
Expand Down

0 comments on commit 4d5d2fc

Please sign in to comment.