aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/kmod.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c
index 48daed4c51ba..ad9f2edebd67 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -205,10 +205,7 @@ static int wait_for_helper(void *data)
205 sub_info->retval = ret; 205 sub_info->retval = ret;
206 } 206 }
207 207
208 if (sub_info->wait == UMH_NO_WAIT) 208 complete(sub_info->complete);
209 call_usermodehelper_freeinfo(sub_info);
210 else
211 complete(sub_info->complete);
212 return 0; 209 return 0;
213} 210}
214 211
@@ -217,13 +214,13 @@ static void __call_usermodehelper(struct work_struct *work)
217{ 214{
218 struct subprocess_info *sub_info = 215 struct subprocess_info *sub_info =
219 container_of(work, struct subprocess_info, work); 216 container_of(work, struct subprocess_info, work);
220 pid_t pid;
221 enum umh_wait wait = sub_info->wait; 217 enum umh_wait wait = sub_info->wait;
218 pid_t pid;
222 219
223 /* CLONE_VFORK: wait until the usermode helper has execve'd 220 /* CLONE_VFORK: wait until the usermode helper has execve'd
224 * successfully We need the data structures to stay around 221 * successfully We need the data structures to stay around
225 * until that is done. */ 222 * until that is done. */
226 if (wait == UMH_WAIT_PROC || wait == UMH_NO_WAIT) 223 if (wait == UMH_WAIT_PROC)
227 pid = kernel_thread(wait_for_helper, sub_info, 224 pid = kernel_thread(wait_for_helper, sub_info,
228 CLONE_FS | CLONE_FILES | SIGCHLD); 225 CLONE_FS | CLONE_FILES | SIGCHLD);
229 else 226 else
@@ -232,6 +229,7 @@ static void __call_usermodehelper(struct work_struct *work)
232 229
233 switch (wait) { 230 switch (wait) {
234 case UMH_NO_WAIT: 231 case UMH_NO_WAIT:
232 call_usermodehelper_freeinfo(sub_info);
235 break; 233 break;
236 234
237 case UMH_WAIT_PROC: 235 case UMH_WAIT_PROC: