* (no subject)
@ 2026-10-19 8:15 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2026-10-19 8:15 UTC (permalink / raw)
To: oe-kbuild, Amadeusz Sławiński; +Cc: lkp, oe-kbuild-all, Mark Brown
tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
head: ba982c33278c1fc739c8c220f410d6539de9d9b9
commit: 568406bc832e7e9e333e2ab05aafd0b83ffb9610 [37/72] ASoC: soc-dapm: Remove widget from cache on removal
config: nios2-randconfig-r2202-20261017 (https://download.01.org/0day-ci/archive/20261018/202610180339.A6POXeNa-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 11.5.0
smatch: v0.5.0-9187-g5189e3fb
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202610180339.A6POXeNa-lkp@intel.com/
smatch warnings:
sound/soc/soc-dapm.c:2893 snd_soc_dapm_free_widget() warn: variable dereferenced before check 'w->dapm' (see line 2891)
vim +2893 sound/soc/soc-dapm.c
b97e26980f6c13 Lars-Peter Clausen 2015-07-21 2870 void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w)
2b97eabc09f42d Richard Purdie 2006-10-06 2871 {
568406bc832e7e Amadeusz Sławiński 2026-10-14 2872 struct snd_soc_dapm_context *d;
2b97eabc09f42d Richard Purdie 2006-10-06 2873 struct snd_soc_dapm_path *p, *next_p;
a3423b02cf745c Lars-Peter Clausen 2015-08-11 2874 enum snd_soc_dapm_direction dir;
2b97eabc09f42d Richard Purdie 2006-10-06 2875
1c9096f32ad23f Kuninori Morimoto 2022-10-17 2876 if (!w)
1c9096f32ad23f Kuninori Morimoto 2022-10-17 2877 return;
1c9096f32ad23f Kuninori Morimoto 2022-10-17 2878
2b97eabc09f42d Richard Purdie 2006-10-06 2879 list_del(&w->list);
5c6679b5cb120f Thomas Hebb 2020-12-12 2880 list_del(&w->dirty);
8ddab3f5107c39 Jarkko Nikula 2010-12-14 2881 /*
8ddab3f5107c39 Jarkko Nikula 2010-12-14 2882 * remove source and sink paths associated to this widget.
8ddab3f5107c39 Jarkko Nikula 2010-12-14 2883 * While removing the path, remove reference to it from both
8ddab3f5107c39 Jarkko Nikula 2010-12-14 2884 * source and sink widgets so that path is removed only once.
8ddab3f5107c39 Jarkko Nikula 2010-12-14 2885 */
af6d53db28e644 Kuninori Morimoto 2026-01-20 2886 dapm_for_each_direction(dir) {
a3423b02cf745c Lars-Peter Clausen 2015-08-11 2887 snd_soc_dapm_widget_for_each_path_safe(w, dir, p, next_p)
8872293fc38c49 Lars-Peter Clausen 2013-06-14 2888 dapm_free_path(p);
a3423b02cf745c Lars-Peter Clausen 2015-08-11 2889 }
8872293fc38c49 Lars-Peter Clausen 2013-06-14 2890
8ad13cdc92f663 Trevor Wu 2023-05-26 @2891 dapm_debugfs_free_widget(w);
^^^^^^^^^^^^^^^^^^^^^^^^^^^
w->dapm dereferenced here
8ad13cdc92f663 Trevor Wu 2023-05-26 2892
568406bc832e7e Amadeusz Sławiński 2026-10-14 @2893 if (w->dapm) {
^^^^^^^
Check is too late.
568406bc832e7e Amadeusz Sławiński 2026-10-14 2894 if (w->dapm->card) {
568406bc832e7e Amadeusz Sławiński 2026-10-14 2895 for_each_card_dapms(w->dapm->card, d) {
568406bc832e7e Amadeusz Sławiński 2026-10-14 2896 if (d->wcache_sink == w)
568406bc832e7e Amadeusz Sławiński 2026-10-14 2897 d->wcache_sink = NULL;
568406bc832e7e Amadeusz Sławiński 2026-10-14 2898 if (d->wcache_source == w)
568406bc832e7e Amadeusz Sławiński 2026-10-14 2899 d->wcache_source = NULL;
568406bc832e7e Amadeusz Sławiński 2026-10-14 2900 }
568406bc832e7e Amadeusz Sławiński 2026-10-14 2901 } else {
568406bc832e7e Amadeusz Sławiński 2026-10-14 2902 if (w->dapm->wcache_sink == w)
568406bc832e7e Amadeusz Sławiński 2026-10-14 2903 w->dapm->wcache_sink = NULL;
568406bc832e7e Amadeusz Sławiński 2026-10-14 2904 if (w->dapm->wcache_source == w)
568406bc832e7e Amadeusz Sławiński 2026-10-14 2905 w->dapm->wcache_source = NULL;
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-19 8:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 8:15 Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.