Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: ipc4/intel: Add missing mutex_unlock()

There was a missing mutex_unlock() in sof_ipc4_widget_free()
use_chain_dma if-branch that caused a static analysis error. The
branch should not be used in a normal working configuration and if its
used its an indication of a bad topology. Add missing mutex_unlock()
and a warning print if the if-branch is taken, and another warning
print to a symmetric place in sof_ipc4_widget_setup().

Fixes: ca5ce0caa67fa9 ("ASoC: SOF: ipc4/intel: Add support for chained DMA")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/202303222050.dCw0fPCW-lkp@intel.com/
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Link: https://lore.kernel.org/r/20230322181830.574635-1-jyri.sarha@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jyri Sarha and committed by
Mark Brown
935d31fd ba31f89c

+9 -2
+9 -2
sound/soc/sof/ipc4-topology.c
··· 1989 1989 case snd_soc_dapm_scheduler: 1990 1990 pipeline = swidget->private; 1991 1991 1992 - if (pipeline->use_chain_dma) 1992 + if (pipeline->use_chain_dma) { 1993 + dev_warn(sdev->dev, "use_chain_dma set for schduler %s", 1994 + swidget->widget->name); 1993 1995 return 0; 1996 + } 1994 1997 1995 1998 dev_dbg(sdev->dev, "pipeline: %d memory pages: %d\n", swidget->pipeline_id, 1996 1999 pipeline->mem_usage); ··· 2148 2145 struct sof_ipc4_msg msg = {{ 0 }}; 2149 2146 u32 header; 2150 2147 2151 - if (pipeline->use_chain_dma) 2148 + if (pipeline->use_chain_dma) { 2149 + dev_warn(sdev->dev, "use_chain_dma set for schduler %s", 2150 + swidget->widget->name); 2151 + mutex_unlock(&ipc4_data->pipeline_state_mutex); 2152 2152 return 0; 2153 + } 2153 2154 2154 2155 header = SOF_IPC4_GLB_PIPE_INSTANCE_ID(swidget->instance_id); 2155 2156 header |= SOF_IPC4_MSG_TYPE_SET(SOF_IPC4_GLB_DELETE_PIPELINE);