summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>2022-06-02 16:57:57 +0300
committerMark Brown <broonie@kernel.org>2022-06-06 14:31:21 +0300
commit2fe08216fda33bbc1f80133b8fd560ffd094b987 (patch)
tree03f8fe36e722ca360512f05397aab7aca4a1d85d /sound/soc
parent07551992cdab1dcb7a17eeaf46b04913712535e8 (diff)
downloadlinux-2fe08216fda33bbc1f80133b8fd560ffd094b987.tar.xz
ASoC: SOF: Fix potential NULL pointer dereference
Cleanup path for sof_prepare_widgets_in_path() should check if unprepare callback exists before calling it, instead it checks if it does not exist. Fix the check. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20220602135757.3335351-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/sof/sof-audio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c
index 8d740635a4bb..28976098a89e 100644
--- a/sound/soc/sof/sof-audio.c
+++ b/sound/soc/sof/sof-audio.c
@@ -318,7 +318,7 @@ sink_prepare:
p->walking = false;
if (ret < 0) {
/* unprepare the source widget */
- if (!widget_ops[widget->id].ipc_unprepare && swidget->prepared) {
+ if (widget_ops[widget->id].ipc_unprepare && swidget->prepared) {
widget_ops[widget->id].ipc_unprepare(swidget);
swidget->prepared = false;
}