Commit 17656973 authored by Takashi Iwai's avatar Takashi Iwai Committed by Luis Henriques

ALSA: usb-audio: Fix runtime PM unbalance

commit 9003ebb1 upstream.

The fix for deadlock in PM in commit [1ee23fe0: 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 wrongly called at probing, leading to unbalance of runtime PM
refcount.

This patch fixes it by correcting the logic.
Reported-by: default avatarHans Yang <hansy@nvidia.com>
Fixes: 1ee23fe0 ('ALSA: usb-audio: Fix deadlocks at resuming')
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 00ed6693
...@@ -663,7 +663,7 @@ int snd_usb_autoresume(struct snd_usb_audio *chip) ...@@ -663,7 +663,7 @@ int snd_usb_autoresume(struct snd_usb_audio *chip)
int err = -ENODEV; int err = -ENODEV;
down_read(&chip->shutdown_rwsem); down_read(&chip->shutdown_rwsem);
if (chip->probing && chip->in_pm) if (chip->probing || chip->in_pm)
err = 0; err = 0;
else if (!chip->shutdown) else if (!chip->shutdown)
err = usb_autopm_get_interface(chip->pm_intf); err = usb_autopm_get_interface(chip->pm_intf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment