lkml.org 
[lkml]   [2009]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/3] perfcounter: Fix storage size allocation of callchain list
    Date
    Fix a confusion while giving the size of a callchain list during
    its allocation. We are using the wrong structure size.

    Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
    ---
    tools/perf/util/callchain.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
    index ad3c285..bbf7813 100644
    --- a/tools/perf/util/callchain.c
    +++ b/tools/perf/util/callchain.c
    @@ -74,7 +74,7 @@ fill_node(struct callchain_node *node, struct ip_callchain *chain, int start)
    for (i = start; i < chain->nr; i++) {
    struct callchain_list *call;

    - call = malloc(sizeof(*chain));
    + call = malloc(sizeof(*call));
    if (!call) {
    perror("not enough memory for the code path tree");
    return;
    --
    1.6.2.3


    \
     
     \ /
      Last update: 2009-07-01 05:37    [W:2.870 / U:0.248 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site