lkml.org 
[lkml]   [2013]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectdo_wait: Add missing tasklist unlocking in error paths.
It looks like both 64a16caf5, and 98abed020 both introduced error paths to do_wait
where we miss unlocking the tasklist.

Spotted with coverity.

Signed-off-by: Dave Jones <davej@fedoraproject.org>

diff --git a/kernel/exit.c b/kernel/exit.c
index a949819..27004a6 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1526,13 +1526,15 @@ repeat:
tsk = current;
do {
retval = do_wait_thread(wo, tsk);
- if (retval)
+ if (retval) {
+ read_unlock(&tasklist_lock);
goto end;
-
+ }
retval = ptrace_do_wait(wo, tsk);
- if (retval)
+ if (retval) {
+ read_unlock(&tasklist_lock);
goto end;
-
+ }
if (wo->wo_flags & __WNOTHREAD)
break;
} while_each_thread(current, tsk);

\
 
 \ /
  Last update: 2013-09-20 19:01    [W:0.029 / U:1.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site