lkml.org 
[lkml]   [2018]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 4.9 043/219] perf probe: Fix concat_probe_trace_events
    Date
    From: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>

    [ Upstream commit f0a30dca5f84fe8048271799b56677ac2279de66 ]

    '*ntevs' contains number of elements present in 'tevs' array. If there
    are no elements in array, 'tevs2' can be directly assigned to 'tevs'
    without allocating more space. So the condition should be '*ntevs == 0'
    not 'ntevs == 0'.

    Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
    Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Fixes: 42bba263eb58 ("perf probe: Allow wildcard for cached events")
    Link: http://lkml.kernel.org/r/20170308065908.4128-1-ravi.bangoria@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    ---
    tools/perf/util/probe-event.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
    index 6a6f44dd594b..4d2e22f8bd94 100644
    --- a/tools/perf/util/probe-event.c
    +++ b/tools/perf/util/probe-event.c
    @@ -3060,7 +3060,7 @@ concat_probe_trace_events(struct probe_trace_event **tevs, int *ntevs,
    struct probe_trace_event *new_tevs;
    int ret = 0;

    - if (ntevs == 0) {
    + if (*ntevs == 0) {
    *tevs = *tevs2;
    *ntevs = ntevs2;
    *tevs2 = NULL;
    --
    2.14.1
    \
     
     \ /
      Last update: 2018-03-04 01:00    [W:4.151 / U:0.076 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site