Release pcm mutex before calling snd_clone_unref(), which in turns might

calling destroy_dev() with sleepable malloc(9). The entire opetation
is being serialized through pcm cv from top down, so dropping mutex is
rather safe.

Reported by:	delphij
This commit is contained in:
Ariff Abdullah 2008-05-27 02:16:05 +00:00
parent eed51f2fb9
commit 2bc599822b

View File

@ -661,7 +661,14 @@ dsp_close(struct cdev *i_dev, int flags, int mode, struct thread *td)
* process.
*/
(void)snd_clone_release(i_dev);
/*
* destroy_dev() might sleep, so release pcm lock
* here and rely on pcm cv serialization.
*/
pcm_unlock(d);
(void)snd_clone_unref(i_dev);
pcm_lock(d);
}
PCM_RELEASE(d);
}