diff options
-rw-r--r-- | kernel/kmod.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c index 689d20f39305..9fcb53a11f87 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c | |||
@@ -143,7 +143,6 @@ struct subprocess_info { | |||
143 | static int ____call_usermodehelper(void *data) | 143 | static int ____call_usermodehelper(void *data) |
144 | { | 144 | { |
145 | struct subprocess_info *sub_info = data; | 145 | struct subprocess_info *sub_info = data; |
146 | enum umh_wait wait = sub_info->wait; | ||
147 | int retval; | 146 | int retval; |
148 | 147 | ||
149 | BUG_ON(atomic_read(&sub_info->cred->usage) != 1); | 148 | BUG_ON(atomic_read(&sub_info->cred->usage) != 1); |
@@ -185,14 +184,10 @@ static int ____call_usermodehelper(void *data) | |||
185 | */ | 184 | */ |
186 | set_user_nice(current, 0); | 185 | set_user_nice(current, 0); |
187 | 186 | ||
188 | if (wait == UMH_WAIT_EXEC) | ||
189 | complete(sub_info->complete); | ||
190 | |||
191 | retval = kernel_execve(sub_info->path, sub_info->argv, sub_info->envp); | 187 | retval = kernel_execve(sub_info->path, sub_info->argv, sub_info->envp); |
192 | 188 | ||
193 | /* Exec failed? */ | 189 | /* Exec failed? */ |
194 | if (wait != UMH_WAIT_EXEC) | 190 | sub_info->retval = retval; |
195 | sub_info->retval = retval; | ||
196 | do_exit(0); | 191 | do_exit(0); |
197 | } | 192 | } |
198 | 193 | ||
@@ -271,14 +266,16 @@ static void __call_usermodehelper(struct work_struct *work) | |||
271 | 266 | ||
272 | switch (wait) { | 267 | switch (wait) { |
273 | case UMH_NO_WAIT: | 268 | case UMH_NO_WAIT: |
274 | case UMH_WAIT_EXEC: | ||
275 | break; | 269 | break; |
276 | 270 | ||
277 | case UMH_WAIT_PROC: | 271 | case UMH_WAIT_PROC: |
278 | if (pid > 0) | 272 | if (pid > 0) |
279 | break; | 273 | break; |
280 | sub_info->retval = pid; | 274 | sub_info->retval = pid; |
281 | break; | 275 | /* FALLTHROUGH */ |
276 | |||
277 | case UMH_WAIT_EXEC: | ||
278 | complete(sub_info->complete); | ||
282 | } | 279 | } |
283 | } | 280 | } |
284 | 281 | ||