Skip to contentSkip to conversation

ASoC: SOF: Fix potential NULL pointer dereference

PATCH New Amadeusz Sławiński 1 participant 1 message Jun 6, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

Fixes 66344c6d9211 ("ASoC: SOF: Add a prepare op to IPC topology widget ops")

---

v2 : Fix Fixes hash, apparently I looked at wrong tree

---
 sound/soc/sof/sof-audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sof/sof-audio.c +1 -1
index 8d740635a4bb..28976098a89e 100644
@@ -318,7 +318,7 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget
 			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;
 				}
Signature · 1 line
2.25.1