Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3218330ybi; Tue, 2 Jul 2019 04:09:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5p/MU2g8vZ148gzGH+w9+e+uNDiwuMSqJW/ndd0x1Sib9Lr24czeWwjSD/ElaGUVIndOE X-Received: by 2002:a65:6541:: with SMTP id a1mr29688323pgw.409.1562065782610; Tue, 02 Jul 2019 04:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562065782; cv=none; d=google.com; s=arc-20160816; b=C6NxftVNAeaATqhxHIZ4uUga7pLJSrPrOazz8iEPUnWuyF+HtWCLrxLgBor4998Pb8 kbsMUhnXJDfcREU342xhfDOAsQM0ZR9bGhbbk5H9h86nu9Xy9j2BRpZJsNIIkY3VF2H8 VqHlou2JJ0gjOD1d4/vnJ5kJG9KhVvZclWF2ipZ9Y3G0Xtj35dRFOXy6rR+Lr2S23d1+ TP4k4BXvZhdLCDPld/U1cVoZ19pJbCqsS+9V8aT/49slb+N4RGfr98SrhJS8ywhA5pWX gzvQmrtETbhMw3M61bqpXlOSXEKJINOCWC+NCJ45/ltDFf3d/BPgwUk/cfJ13yPUZdV7 kkXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ZFF7OVSYouT5zhokUhNORGE2Ivi0juiit4EKm7m3eFM=; b=0TmC7CZP4aPG0e6O2SDYSNnWeiFLwnIPbWOPiBZp4Ir4M2pcf9UICeN6RwPmCwTN0j w8HOJM32tiGICVO5SW34UnvF5wEENfSZpLE8hj2yTWKMA08Rn+viOenbE/dAeYR5cYoH vgk0gDNCR2o2IEvAqolhUa00Zeh3oLhtIy/o7CEif3ze3roC/9WrVvTAkhv36dBs5ZTV 3gZQpkBFlMqtN5XF9bb5cHDY5xCDQCtLxD5n/g/w1rm5oqAp994jiy0F25CP3MO5l64Z 7rAZnHVnozO20e9kGfuNW/xD1RJ4hMcfqUBO5O25IM/wG9stVg7CZjH58o/HFZUHOKUC mYwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si13549292pld.40.2019.07.02.04.09.27; Tue, 02 Jul 2019 04:09:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726695AbfGBLH7 (ORCPT + 99 others); Tue, 2 Jul 2019 07:07:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34606 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbfGBLH6 (ORCPT ); Tue, 2 Jul 2019 07:07:58 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D63E88313; Tue, 2 Jul 2019 11:07:53 +0000 (UTC) Received: from krava (unknown [10.43.17.81]) by smtp.corp.redhat.com (Postfix) with SMTP id 345422D351; Tue, 2 Jul 2019 11:07:44 +0000 (UTC) Date: Tue, 2 Jul 2019 13:07:43 +0200 From: Jiri Olsa To: Leo Yan Cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Namhyung Kim , Mathieu Poirier , Suzuki K Poulose , Andi Kleen , "David S. Miller" , Davidlohr Bueso , Rasmus Villemoes , Jin Yao , Song Liu , Adrian Hunter , Alexios Zavras , Thomas Gleixner , Changbin Du , Eric Saint-Etienne , Konstantin Khlebnikov , Thomas Richter , Alexey Budankov , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 00/11] perf: Fix errors detected by Smatch Message-ID: <20190702110743.GA12694@krava> References: <20190702103420.27540-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190702103420.27540-1-leo.yan@linaro.org> User-Agent: Mutt/1.12.0 (2019-05-25) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 02 Jul 2019 11:07:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 02, 2019 at 06:34:09PM +0800, Leo Yan wrote: > When I used static checker Smatch for perf building, the main target is > to check if there have any potential issues in Arm cs-etm code. So > finally I get many reporting for errors/warnings. > > I used below command for using static checker with perf building: > > # make VF=1 CORESIGHT=1 -C tools/perf/ \ > CHECK="/root/Work/smatch/smatch --full-path" \ > CC=/root/Work/smatch/cgcc | tee smatch_reports.txt > > I reviewed the errors one by one, if I understood some of these errors > so changed the code as I can, this patch set is the working result; but > still leave some errors due to I don't know what's the best way to fix > it. There also have many inconsistent indenting warnings. So I firstly > send out this patch set and let's see what's the feedback from public > reviewing. > > Leo Yan (11): > perf report: Smatch: Fix potential NULL pointer dereference > perf stat: Smatch: Fix use-after-freed pointer > perf top: Smatch: Fix potential NULL pointer dereference > perf annotate: Smatch: Fix dereferencing freed memory > perf trace: Smatch: Fix potential NULL pointer dereference > perf hists: Smatch: Fix potential NULL pointer dereference > perf map: Smatch: Fix potential NULL pointer dereference > perf session: Smatch: Fix potential NULL pointer dereference > perf intel-bts: Smatch: Fix potential NULL pointer dereference > perf intel-pt: Smatch: Fix potential NULL pointer dereference > perf cs-etm: Smatch: Fix potential NULL pointer dereference from quick look it all looks good to me, nice tool ;-) Acked-by: Jiri Olsa jirka > > tools/perf/builtin-report.c | 4 ++-- > tools/perf/builtin-stat.c | 2 +- > tools/perf/builtin-top.c | 8 ++++++-- > tools/perf/builtin-trace.c | 5 +++-- > tools/perf/ui/browsers/hists.c | 13 +++++++++---- > tools/perf/util/annotate.c | 6 ++---- > tools/perf/util/cs-etm.c | 2 +- > tools/perf/util/intel-bts.c | 5 ++--- > tools/perf/util/intel-pt.c | 5 ++--- > tools/perf/util/map.c | 7 +++++-- > tools/perf/util/session.c | 3 +++ > 11 files changed, 36 insertions(+), 24 deletions(-) > > -- > 2.17.1 >