x86, bts: fix unlock problem in ds.c
authorMarkus Metzger <markus.t.metzger@googlemail.com>
Sat, 15 Nov 2008 10:00:17 +0000 (11:00 +0100)
committerIngo Molnar <mingo@elte.hu>
Sun, 16 Nov 2008 07:25:36 +0000 (08:25 +0100)
Fix a problem where ds_request() returned an error without releasing the
ds lock.

Reported-by: Stephane Eranian <eranian@gmail.com>
Signed-off-by: Markus Metzger <markus.t.metzger@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/ds.c

index 2b69994fd3a800458f4d81abbebad357405eac69..ac1d5b0586ba129199e32c7eebee55cccf55131e 100644 (file)
@@ -384,8 +384,9 @@ static int ds_request(struct task_struct *task, void *base, size_t size,
 
        spin_lock(&ds_lock);
 
+       error = -EPERM;
        if (!check_tracer(task))
-               return -EPERM;
+               goto out_unlock;
 
        error = -ENOMEM;
        context = ds_alloc_context(task);