summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@slimlogic.co.uk>2011-04-07 08:40:03 +0100
committerAndy Green <andy.green@linaro.org>2011-04-07 08:40:03 +0100
commitab984dd778f785d807b1e8f32c666e6a9195a897 (patch)
tree1f88c18a46f3230b32b18767cb55459f43619213 /sound
parent01abc5d827bd7f80e49a7e1398aa65999604f4eb (diff)
ALSA: pcm: reject calls to open backend PCMs
This stops userspace opening backend PCMs. Change-Id: Ide3df013f158a4ad49da2bfcacb91aa8f3b6970b Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/pcm_native.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 94433e1a103..f46591eb744 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -2029,6 +2029,12 @@ int snd_pcm_open_substream(struct snd_pcm *pcm, int stream,
goto error;
}
+ if (substream->ops == NULL) {
+ snd_printd("cannot open back end PCMs directly\n");
+ err = -ENODEV;
+ goto error;
+ }
+
if ((err = substream->ops->open(substream)) < 0)
goto error;