Skip to contentSkip to conversation

ALSA: usb-audio: Fix runtime PM unbalance

PATCH New Takashi Iwai 1 participant 1 message Aug 19, 2015 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: usb-audio: Fix runtime PM unbalance

The fix for deadlock in PM in commit [1ee23fe07ee8: ALSA: usb-audio:
Fix deadlocks at resuming] introduced a new check of in_pm flag. However, the brainless patch author evaluated it in a wrong way (logical AND instead of logical OR), thus usb_autopm_get_interface() is never called, leading to unbalance of runtime PM refcount.

This patch fixes it by correcting the logic.

Fixes 1ee23fe07ee8 ('ALSA: usb-audio: Fix deadlocks at resuming')
Cc <[email protected]> [v3.15+]
---
 sound/usb/card.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/card.c +1 -1
index 1fab9778807a..0450593980fd 100644
@@ -638,7 +638,7 @@ int snd_usb_autoresume(struct snd_usb_audio *chip)
 	int err = -ENODEV;
 
 	down_read(&chip->shutdown_rwsem);
-	if (chip->probing && chip->in_pm)
+	if (chip->probing || chip->in_pm)
 		err = 0;
 	else if (!chip->shutdown)
 		err = usb_autopm_get_interface(chip->pm_intf);
Signature · 1 line
2.5.0