aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/pcm_compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/pcm_compat.c')
-rw-r--r--sound/core/pcm_compat.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
index 1f64ab0c2a95..7ae080bae15c 100644
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -426,6 +426,8 @@ static int snd_pcm_ioctl_xfern_compat(struct snd_pcm_substream *substream,
return -ENOTTY;
if (substream->stream != dir)
return -EINVAL;
+ if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN)
+ return -EBADFD;
if ((ch = substream->runtime->channels) > 128)
return -EINVAL;