[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b10265c1-6c11-db3b-29cd-62db0a7c0b3d@gmail.com>
Date: Mon, 30 Jan 2017 19:26:30 +0900
From: Taeung Song <treeze.taeung@...il.com>
To: Jiri Olsa <jolsa@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Wang Nan <wangnan0@...wei.com>
Subject: Re: [PATCH 2/2] perf evsel: Check for NULL before
perf_evsel__is_bpf_output()
Hi, jirka :)
Thank you!
Taeung
On 01/30/2017 05:55 PM, Jiri Olsa wrote:
> On Mon, Jan 30, 2017 at 02:23:39PM +0900, Taeung Song wrote:
>> If 'evsel' is NULL, in perf_evsel__is_bpf_output()
>> NULL pointer error can happen so check it.
>>
>> Cc: Jiri Olsa <jolsa@...hat.com>
>> Cc: Namhyung Kim <namhyung@...nel.org>
>> Signed-off-by: Taeung Song <treeze.taeung@...il.com>
>> ---
>> tools/perf/util/evsel.c | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
>> index 04e536a..b77da72 100644
>> --- a/tools/perf/util/evsel.c
>> +++ b/tools/perf/util/evsel.c
>> @@ -242,8 +242,10 @@ struct perf_evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx)
>> {
>> struct perf_evsel *evsel = zalloc(perf_evsel__object.size);
>>
>> - if (evsel != NULL)
>> - perf_evsel__init(evsel, attr, idx);
>> + if (!evsel)
>> + return NULL;
>> +
>> + perf_evsel__init(evsel, attr, idx);
>
> Acked-by: Jiri Olsa <jolsa@...nel.org>
>
> thanks,
> jirka
>
Powered by blists - more mailing lists