Skip to content

Commit

Permalink
ALSA: usb-audio: Fix runtime PM unbalance
Browse files Browse the repository at this point in the history
The fix for deadlock in PM in commit [1ee23fe: 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: Hans Yang <[email protected]>
Fixes: 1ee23fe ('ALSA: usb-audio: Fix deadlocks at resuming')
Cc: <[email protected]> [v3.15+]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Aug 19, 2015
1 parent 7ccb0a9 commit 9003ebb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/usb/card.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9003ebb

Please sign in to comment.