]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
perf tools: Fix buffer allocation
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 24 Sep 2009 13:05:59 +0000 (15:05 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 16:31:46 +0000 (09:31 -0700)
commit a255a9981a8566a1efabec983b7811e937e662d2 upstream.

"perf top" cores dump on my dev machine, if run from a directory
where vmlinux is present:

  *** glibc detected *** malloc(): memory corruption: 0x085670d0 ***

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
LKML-Reference: <4ABB6EB7.7000002@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
tools/perf/util/module.c

index ddabe925d65dcf7b3feb75d9520d4948ceadb16e..702083d342ff7726e95ea83abd8958e46f8de603 100644 (file)
@@ -422,7 +422,7 @@ static int mod_dso__load_module_paths(struct mod_dso *self)
        len += strlen(uts.release);
        len += strlen("/modules.dep");
 
-       path = calloc(1, len);
+       path = calloc(1, len + 1);
        if (path == NULL)
                goto out_failure;