diff options
| author | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-05-31 09:23:19 +0100 |
|---|---|---|
| committer | Andy Green <andy.green@linaro.org> | 2011-05-31 11:04:48 +0100 |
| commit | ffeda37fa657a9da08d431b571bfd9e0adfc435b (patch) | |
| tree | 770250fa571e3c18f5cbaee19fcfd8f39633f895 /sound | |
| parent | 4ad02571ac347522e9cd3fcf68f5c251847c141a (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.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 4c9e005903e..c5a97a8958d 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; |
