]> git.baikalelectronics.ru Git - kernel.git/commit
perf/hwbp: Fix a possible memory leak
authorNamhyung Kim <namhyung.kim@lge.com>
Tue, 28 Feb 2012 01:19:38 +0000 (10:19 +0900)
committerIngo Molnar <mingo@elte.hu>
Tue, 28 Feb 2012 08:52:54 +0000 (09:52 +0100)
commit99ea51051ebe5d9057b7958582bba943cbdc5db9
tree8fc423281dc55f09463e20c279f5b4200ad9e383
parent25e95a6176830b48db86c8d04c3ac5a96c65e3df
perf/hwbp: Fix a possible memory leak

If kzalloc() for TYPE_DATA failed on a given cpu, previous chunk
of TYPE_INST will be leaked. Fix it.

Thanks to Peter Zijlstra for suggesting this better solution. It
should work as long as the initial value of the region is all
0's and that's the case of static (per-cpu) memory allocation.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Link: http://lkml.kernel.org/r/1330391978-28070-1-git-send-email-namhyung.kim@lge.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/events/hw_breakpoint.c