Re: [patch] x86, bts: fix unlock problem in ds.c

From: stephane eranian
Date: Thu Nov 20 2008 - 16:14:55 EST


Markus,

I think this patch is not quite right. You don't want to go out via out_unlock
because you're going to call ds_put_context)() when you did not invoke the
matching ds_get_context() (hidden in ds_alloc_context). It happens later in
the ds_request() function.


On Sat, Nov 15, 2008 at 11:00 AM, Markus Metzger
<markus.t.metzger@xxxxxxxxxxxxxx> wrote:
> Fix a problem where ds_request() returned an error without releasing the
> ds lock.
>
> Reported-by: Stephane Eranian <eranian@xxxxxxxxx>
> Signed-off-by: Markus Metzger <markus.t.metzger@xxxxxxxxx>
> ---
>
> Index: gits/arch/x86/kernel/ds.c
> ===================================================================
> --- gits.orig/arch/x86/kernel/ds.c 2008-11-15 10:51:51.000000000 +0100
> +++ gits/arch/x86/kernel/ds.c 2008-11-15 10:53:43.000000000 +0100
> @@ -384,8 +384,9 @@
>
> spin_lock(&ds_lock);
>
> + error = -EPERM;
> if (!check_tracer(task))
> - return -EPERM;
> + goto out_unlock;
>
> error = -ENOMEM;
> context = ds_alloc_context(task);
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/