lkml.org 
[lkml]   [2012]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] perf: Don't call release_callchain_buffers if alloc fails
On Fri, Jan 20, 2012 at 10:12:45AM +0900, Namhyung Kim wrote:
> When alloc_callchain_buffers() fails, it frees all of
> entries before return. In addition, calling the
> release_callchain_buffers() will cause a NULL pointer
> dereference since callchain_cpu_entries is not set.
>
> Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>

Acked-by: Frederic Weisbecker <fweisbec@gmail.com>

> ---
> kernel/events/callchain.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/events/callchain.c b/kernel/events/callchain.c
> index 057e24b665cf..6581a040f399 100644
> --- a/kernel/events/callchain.c
> +++ b/kernel/events/callchain.c
> @@ -115,8 +115,6 @@ int get_callchain_buffers(void)
> }
>
> err = alloc_callchain_buffers();
> - if (err)
> - release_callchain_buffers();
> exit:
> mutex_unlock(&callchain_mutex);
>
> --
> 1.7.9.rc1.dirty
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/


\
 
 \ /
  Last update: 2012-01-20 05:01    [W:1.960 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site