summaryrefslogtreecommitdiff
path: root/sound/core/pcm_native.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-09-01 10:38:00 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-09-01 10:38:00 -0700
commit381cce59a9d937d686f0b205fa2641499c81c6e6 (patch)
treedd35c8c0f253aa6d0f56bb94bd12a2cd9d2594c9 /sound/core/pcm_native.c
parentbba2a5b8221850418846d62887d5de311df335f9 (diff)
parent83b033bd33a8b7b16f568e3432d3e27d03ef9c82 (diff)
Merge tag 'sound-4.13-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Three regression fixes that should be addressed before the final release: a missing mutex call in OSS PCM emulation ioctl, ASoC rt5670 headset detection breakage, and a regression in simple-card parser code" * tag 'sound-4.13-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ASoC: simple_card_utils: fix fallback when "label" property isn't present ALSA: pcm: Fix power lock unbalance via OSS emulation ASoC: rt5670: Fix GPIO headset detection regression
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r--sound/core/pcm_native.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 22995cb3bd44..cf0433f80067 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3064,6 +3064,7 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream,
{
snd_pcm_uframes_t *frames = arg;
snd_pcm_sframes_t result;
+ int err;
switch (cmd) {
case SNDRV_PCM_IOCTL_FORWARD:
@@ -3083,7 +3084,10 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream,
case SNDRV_PCM_IOCTL_START:
return snd_pcm_start_lock_irq(substream);
case SNDRV_PCM_IOCTL_DRAIN:
- return snd_pcm_drain(substream, NULL);
+ snd_power_lock(substream->pcm->card);
+ err = snd_pcm_drain(substream, NULL);
+ snd_power_unlock(substream->pcm->card);
+ return err;
case SNDRV_PCM_IOCTL_DROP:
return snd_pcm_drop(substream);
case SNDRV_PCM_IOCTL_DELAY: