From 8ccfb4a31fbc16e01e93d7989019e04c69a6284d Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Wed, 16 Feb 2011 16:50:12 +0000 Subject: [PATCH] ALSA: pcm - reject calls to open backend PCMs (temporary) This stops userspace opening backlemd PCMs. TODO: rework for upstream. Signed-off-by: Liam Girdwood --- sound/core/pcm_native.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index c6698efb44c..0e972485449 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -2036,6 +2036,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;