Patch "ASoC: SOF: topology: simplify code to prevent static analysis warnings" has been added to the 6.5-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ASoC: SOF: topology: simplify code to prevent static analysis warnings

to the 6.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     asoc-sof-topology-simplify-code-to-prevent-static-an.patch
and it can be found in the queue-6.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0d14a4290b981b0d78fe9371e97337fd6d79257a
Author: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx>
Date:   Mon Jul 31 16:37:43 2023 -0500

    ASoC: SOF: topology: simplify code to prevent static analysis warnings
    
    [ Upstream commit 55cb3dc271d81f1982c949a2ac483a6daf613b92 ]
    
    make KCFLAGS='-fanalyzer' sound/soc/sof/intel/ reports a possible NULL
    pointer dereference.
    
    sound/soc/sof/topology.c:1136:21: error: dereference of NULL ‘w’
    [CWE-476] [-Werror=analyzer-null-dereference]
    
     1136 |     strcmp(w->sname, rtd->dai_link->stream_name))
    
    The code is rather confusing and can be simplified to make static
    analysis happy. No functionality change.
    
    Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx>
    Reviewed-by: Rander Wang <rander.wang@xxxxxxxxx>
    Reviewed-by: Daniel Baluta <daniel.baluta@xxxxxxx>
    Reviewed-by: Yaochun Hung <yc.hung@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230731213748.440285-4-pierre-louis.bossart@xxxxxxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 698129dccc7df..3866dd3cba695 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -1117,10 +1117,11 @@ static void sof_disconnect_dai_widget(struct snd_soc_component *scomp,
 {
 	struct snd_soc_card *card = scomp->card;
 	struct snd_soc_pcm_runtime *rtd;
+	const char *sname = w->sname;
 	struct snd_soc_dai *cpu_dai;
 	int i, stream;
 
-	if (!w->sname)
+	if (!sname)
 		return;
 
 	if (w->id == snd_soc_dapm_dai_out)
@@ -1133,7 +1134,7 @@ static void sof_disconnect_dai_widget(struct snd_soc_component *scomp,
 	list_for_each_entry(rtd, &card->rtd_list, list) {
 		/* does stream match DAI link ? */
 		if (!rtd->dai_link->stream_name ||
-		    strcmp(w->sname, rtd->dai_link->stream_name))
+		    strcmp(sname, rtd->dai_link->stream_name))
 			continue;
 
 		for_each_rtd_cpu_dais(rtd, i, cpu_dai)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux