make sure that kernel_thread() callbacks call do_exit() themselves
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 11 Oct 2012 00:09:44 +0000 (20:09 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 12 Oct 2012 01:42:36 +0000 (21:42 -0400)
Most of them never returned anyway - only two functions had to be
changed.  That allows to simplify their callers a whole lot.

Note that this does *not* apply to kthread_run() callbacks - all of
those had been called from the same kernel_thread() callback, which
did do_exit() already.  This is strictly about very few low-level
kernel_thread() callbacks (there are only 6 of those, mostly as part
of kthread.h and kmod.h exported mechanisms, plus kernel_init()
itself).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
kernel/kmod.c

index 6f99aead66c6b897fbe14b9fb03b2a77bd17bc47..b6e5ca9c758a54cac68805cf1c840ca0b8cd107f 100644 (file)
@@ -225,7 +225,7 @@ static int ____call_usermodehelper(void *data)
        /* Exec failed? */
 fail:
        sub_info->retval = retval;
-       return 0;
+       do_exit(0);
 }
 
 static int call_helper(void *data)
@@ -292,7 +292,7 @@ static int wait_for_helper(void *data)
        }
 
        umh_complete(sub_info);
-       return 0;
+       do_exit(0);
 }
 
 /* This is run by khelper thread  */