[ALSA] Fix hang-up at disconnection of usb-audio
Fix hang-up at disconnection of usb-audio devices while accessing PCM. Don't handle PCM operations any more after shutdown flag is set. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
This commit is contained in:
committed by
Jaroslav Kysela
parent
282e0c87f2
commit
de1b8b93a0
@@ -2359,7 +2359,8 @@ static int snd_pcm_oss_release(struct inode *inode, struct file *file)
|
||||
substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE];
|
||||
snd_assert(substream != NULL, return -ENXIO);
|
||||
pcm = substream->pcm;
|
||||
snd_pcm_oss_sync(pcm_oss_file);
|
||||
if (!pcm->card->shutdown)
|
||||
snd_pcm_oss_sync(pcm_oss_file);
|
||||
mutex_lock(&pcm->open_mutex);
|
||||
snd_pcm_oss_release_file(pcm_oss_file);
|
||||
mutex_unlock(&pcm->open_mutex);
|
||||
|
Reference in New Issue
Block a user