Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: mediatek: initialize panic_info to zero
@ 2022-12-13 11:56 YC Hung
  2022-12-13 18:13 ` Curtis Malainey
  2022-12-14 14:53 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: YC Hung @ 2022-12-13 11:56 UTC (permalink / raw)
  Cc: Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Matthias Brugger, YC Hung,
	Chao Song, sound-open-firmware, alsa-devel, linux-arm-kernel,
	linux-mediatek, linux-kernel, chunxu.li, Trevor Wu,
	Curtis Malainey

Coverity spotted that panic_info is not initialized to zero in
mtk_adsp_dump. Using uninitialized value panic_info.linenum when
calling snd_sof_get_status. Fix this coverity by initializing
panic_info struct as zero.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
---
 sound/soc/sof/mediatek/mtk-adsp-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sof/mediatek/mtk-adsp-common.c b/sound/soc/sof/mediatek/mtk-adsp-common.c
index 1e0769c668a7..de8dbe27cd0d 100644
--- a/sound/soc/sof/mediatek/mtk-adsp-common.c
+++ b/sound/soc/sof/mediatek/mtk-adsp-common.c
@@ -60,7 +60,7 @@ void mtk_adsp_dump(struct snd_sof_dev *sdev, u32 flags)
 {
 	char *level = (flags & SOF_DBG_DUMP_OPTIONAL) ? KERN_DEBUG : KERN_ERR;
 	struct sof_ipc_dsp_oops_xtensa xoops;
-	struct sof_ipc_panic_info panic_info;
+	struct sof_ipc_panic_info panic_info = {};
 	u32 stack[MTK_ADSP_STACK_DUMP_SIZE];
 	u32 status;
 
-- 
2.18.0



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

end of thread, other threads:[~2022-12-14 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-13 11:56 [PATCH] ASoC: SOF: mediatek: initialize panic_info to zero YC Hung
2022-12-13 18:13 ` Curtis Malainey
2022-12-14 14:53 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox