Commit 8c703d66 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Linus Torvalds
Browse files

kernel/umh.c: optimize 'proc_cap_handler()'

If 'write' is 0, we can avoid a call to spin_lock/spin_unlock.


Signed-off-by: default avatarChristophe JAILLET <>
Acked-by: default avatarLuis R. Rodriguez <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 4ca59b14
......@@ -537,14 +537,14 @@ static int proc_cap_handler(struct ctl_table *table, int write,
* Drop everything not in the new_cap (but don't add things)
if (write) {
if (table->data == CAP_BSET)
usermodehelper_bset = cap_intersect(usermodehelper_bset, new_cap);
if (table->data == CAP_PI)
usermodehelper_inheritable = cap_intersect(usermodehelper_inheritable, new_cap);
return 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment