This is a note to let you know that I've just added the patch titled ASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL to the 6.1-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-sof-audio-skip-prepare-unprepare-if-swidget-is-null.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 0ad84b11f2f8dd19d62d0b2ffd95ece897e6c3dc Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@xxxxxxxxxxxxxxx> Date: Wed, 18 Jan 2023 12:12:54 +0200 Subject: ASoC: SOF: sof-audio: skip prepare/unprepare if swidget is NULL From: Ranjani Sridharan <ranjani.sridharan@xxxxxxxxxxxxxxx> commit 0ad84b11f2f8dd19d62d0b2ffd95ece897e6c3dc upstream. Skip preparing/unpreparing widgets if the swidget pointer is NULL. This will be true in the case of virtual widgets in topology that were added for reusing the legacy HDA machine driver with SOF. Fixes: 9862dcf70245 ("ASoC: SOF: don't unprepare widget used other pipelines") Cc: <stable@xxxxxxxxxxxxxxx> # 6.1 Signed-off-by: Ranjani Sridharan <ranjani.sridharan@xxxxxxxxxxxxxxx> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@xxxxxxxxxxxxxxx> Reviewed-by: Rander Wang <rander.wang@xxxxxxxxx> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@xxxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20230118101255.29139-3-peter.ujfalusi@xxxxxxxxxxxxxxx Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- sound/soc/sof/sof-audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@ -272,7 +272,7 @@ sof_unprepare_widgets_in_path(struct snd struct snd_soc_dapm_path *p; /* return if the widget is in use or if it is already unprepared */ - if (!swidget->prepared || swidget->use_count > 0) + if (!swidget || !swidget->prepared || swidget->use_count > 0) return; if (widget_ops[widget->id].ipc_unprepare) @@ -303,7 +303,7 @@ sof_prepare_widgets_in_path(struct snd_s struct snd_soc_dapm_path *p; int ret; - if (!widget_ops[widget->id].ipc_prepare || swidget->prepared) + if (!swidget || !widget_ops[widget->id].ipc_prepare || swidget->prepared) goto sink_prepare; /* prepare the source widget */ Patches currently in stable-queue which might be from ranjani.sridharan@xxxxxxxxxxxxxxx are queue-6.1/asoc-sof-keep-prepare-unprepare-widgets-in-sink-path.patch queue-6.1/asoc-sof-sof-audio-unprepare-when-swidget-use_count-0.patch queue-6.1/asoc-sof-sof-audio-skip-prepare-unprepare-if-swidget-is-null.patch