aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kmod.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-09-30 23:45:41 -0400
committerJeff Garzik <jeff@garzik.org>2006-09-30 23:45:41 -0400
commit1c7da74c4aab595a994beb5fe728ebf0d0b41f59 (patch)
tree64128abdf9550ebb51d8f3ee6732d7350b9c62f2 /kernel/kmod.c
parentaebb1153ac54ddbbd3d3f0481a193f4bf0ead53b (diff)
parent1bdfd554be94def718323659173517c5d4a69d25 (diff)
Merge branch 'master' into upstream
Diffstat (limited to 'kernel/kmod.c')
-rw-r--r--kernel/kmod.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c
index 5c470c57fb57..842f8015d7fd 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -176,6 +176,8 @@ static int wait_for_helper(void *data)
176 if (pid < 0) { 176 if (pid < 0) {
177 sub_info->retval = pid; 177 sub_info->retval = pid;
178 } else { 178 } else {
179 int ret;
180
179 /* 181 /*
180 * Normally it is bogus to call wait4() from in-kernel because 182 * Normally it is bogus to call wait4() from in-kernel because
181 * wait4() wants to write the exit code to a userspace address. 183 * wait4() wants to write the exit code to a userspace address.
@@ -185,7 +187,15 @@ static int wait_for_helper(void *data)
185 * 187 *
186 * Thus the __user pointer cast is valid here. 188 * Thus the __user pointer cast is valid here.
187 */ 189 */
188 sys_wait4(pid, (int __user *) &sub_info->retval, 0, NULL); 190 sys_wait4(pid, (int __user *)&ret, 0, NULL);
191
192 /*
193 * If ret is 0, either ____call_usermodehelper failed and the
194 * real error code is already in sub_info->retval or
195 * sub_info->retval is 0 anyway, so don't mess with it then.
196 */
197 if (ret)
198 sub_info->retval = ret;
189 } 199 }
190 200
191 complete(sub_info->complete); 201 complete(sub_info->complete);