diff options
author | Jiri Kosina <jkosina@suse.cz> | 2011-07-11 08:15:48 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-07-11 08:15:55 -0400 |
commit | b7e9c223be8ce335e30f2cf6ba588e6a4092275c (patch) | |
tree | 2d1e3b75606abc18df7ad65e51ac3f90cd68b38d /kernel/kmod.c | |
parent | c172d82500a6cf3c32d1e650722a1055d72ce858 (diff) | |
parent | e3bbfa78bab125f58b831b5f7f45b5a305091d72 (diff) |
Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply pending patches that
are based on newer code already present upstream.
Diffstat (limited to 'kernel/kmod.c')
-rw-r--r-- | kernel/kmod.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c index ad6a81c58b44..47613dfb7b28 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c | |||
@@ -156,12 +156,6 @@ static int ____call_usermodehelper(void *data) | |||
156 | */ | 156 | */ |
157 | set_user_nice(current, 0); | 157 | set_user_nice(current, 0); |
158 | 158 | ||
159 | if (sub_info->init) { | ||
160 | retval = sub_info->init(sub_info); | ||
161 | if (retval) | ||
162 | goto fail; | ||
163 | } | ||
164 | |||
165 | retval = -ENOMEM; | 159 | retval = -ENOMEM; |
166 | new = prepare_kernel_cred(current); | 160 | new = prepare_kernel_cred(current); |
167 | if (!new) | 161 | if (!new) |
@@ -173,6 +167,14 @@ static int ____call_usermodehelper(void *data) | |||
173 | new->cap_inheritable); | 167 | new->cap_inheritable); |
174 | spin_unlock(&umh_sysctl_lock); | 168 | spin_unlock(&umh_sysctl_lock); |
175 | 169 | ||
170 | if (sub_info->init) { | ||
171 | retval = sub_info->init(sub_info, new); | ||
172 | if (retval) { | ||
173 | abort_creds(new); | ||
174 | goto fail; | ||
175 | } | ||
176 | } | ||
177 | |||
176 | commit_creds(new); | 178 | commit_creds(new); |
177 | 179 | ||
178 | retval = kernel_execve(sub_info->path, | 180 | retval = kernel_execve(sub_info->path, |
@@ -388,7 +390,7 @@ EXPORT_SYMBOL(call_usermodehelper_setup); | |||
388 | * context in which call_usermodehelper_exec is called. | 390 | * context in which call_usermodehelper_exec is called. |
389 | */ | 391 | */ |
390 | void call_usermodehelper_setfns(struct subprocess_info *info, | 392 | void call_usermodehelper_setfns(struct subprocess_info *info, |
391 | int (*init)(struct subprocess_info *info), | 393 | int (*init)(struct subprocess_info *info, struct cred *new), |
392 | void (*cleanup)(struct subprocess_info *info), | 394 | void (*cleanup)(struct subprocess_info *info), |
393 | void *data) | 395 | void *data) |
394 | { | 396 | { |