git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
sound: snd_ctl_remove_user_ctl: prevent removal of kernel controls
[safe/jmp/linux-2.6]
/
sound
/
core
/
control.c
diff --git
a/sound/core/control.c
b/sound/core/control.c
index
bc64b72
..
a8b7fab
100644
(file)
--- a/
sound/core/control.c
+++ b/
sound/core/control.c
@@
-436,6
+436,10
@@
static int snd_ctl_remove_user_ctl(struct snd_ctl_file * file,
ret = -ENOENT;
goto error;
}
+ if (!(kctl->vd[0].access & SNDRV_CTL_ELEM_ACCESS_USER)) {
+ ret = -EINVAL;
+ goto error;
+ }
for (idx = 0; idx < kctl->count; idx++)
if (kctl->vd[idx].owner != NULL && kctl->vd[idx].owner != file) {
ret = -EBUSY;