Skip to contentSkip to conversation

greybus/audio_helper: Add missing unlock to avoid mismatched lock

PATCH In review Zheng Yongjun 2 participants 2 messages Dec 21, 2020

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

PATCH 1/1 greybus/audio_helper: Add missing unlock to avoid mismatched lock

Fix a missing unlock in the error branch.

---
 drivers/staging/greybus/audio_helper.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/greybus/audio_helper.c +1 -0
index 237531ba60f3..293675dbea10 100644
@@ -135,6 +135,7 @@ int gbaudio_dapm_free_controls(struct snd_soc_dapm_context *dapm,
 		if (!w) {
 			dev_err(dapm->dev, "%s: widget not found\n",
 				widget->name);
+			mutex_unlock(&dapm->card->dapm_mutex);
 			return -EINVAL;
 		}
 		widget++;
Signature · 1 line
2.22.0
maintainer
#1 lore raw
Quoted 12 lines · Zheng Yongjun

Fix a missing unlock in the error branch.

---
 drivers/staging/greybus/audio_helper.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/greybus/audio_helper.c +0 -0
index 237531ba60f3..293675dbea10 100644

drivers/staging/greybus/audio_helper.c int gbaudio_dapm_free_controls(struct snd_soc_dapm_context *dapm, · line 141

Quoted 7 lines
drivers/staging/greybus/audio_helper.c +1 -0
@@ -135,6 +135,7 @@ int gbaudio_dapm_free_controls(struct snd_soc_dapm_context *dapm,
 		if (!w) {
 			dev_err(dapm->dev, "%s: widget not found\n",
 				widget->name);
+			mutex_unlock(&dapm->card->dapm_mutex);
 			return -EINVAL;
 		}
 		widget++;

This has already been fixed in mainline by your colleague:

e77b259f67ab ("staging: greybus: audio: Fix possible leak free widgets in gbaudio_dapm_free_controls")

It seems you're all working on reports from your "Hulk Robot" so perhaps you can try to coordinate that internally.

Johan