|
@@ -28,6 +28,7 @@
|
|
|
#include <sound/core.h>
|
|
#include <sound/core.h>
|
|
|
#include <sound/minors.h>
|
|
#include <sound/minors.h>
|
|
|
#include <sound/pcm.h>
|
|
#include <sound/pcm.h>
|
|
|
|
|
+#include <sound/timer.h>
|
|
|
#include <sound/control.h>
|
|
#include <sound/control.h>
|
|
|
#include <sound/info.h>
|
|
#include <sound/info.h>
|
|
|
|
|
|
|
@@ -1054,8 +1055,13 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream)
|
|
|
snd_free_pages((void*)runtime->control,
|
|
snd_free_pages((void*)runtime->control,
|
|
|
PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control)));
|
|
PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control)));
|
|
|
kfree(runtime->hw_constraints.rules);
|
|
kfree(runtime->hw_constraints.rules);
|
|
|
- kfree(runtime);
|
|
|
|
|
|
|
+ /* Avoid concurrent access to runtime via PCM timer interface */
|
|
|
|
|
+ if (substream->timer)
|
|
|
|
|
+ spin_lock_irq(&substream->timer->lock);
|
|
|
substream->runtime = NULL;
|
|
substream->runtime = NULL;
|
|
|
|
|
+ if (substream->timer)
|
|
|
|
|
+ spin_unlock_irq(&substream->timer->lock);
|
|
|
|
|
+ kfree(runtime);
|
|
|
put_pid(substream->pid);
|
|
put_pid(substream->pid);
|
|
|
substream->pid = NULL;
|
|
substream->pid = NULL;
|
|
|
substream->pstr->substream_opened--;
|
|
substream->pstr->substream_opened--;
|