Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp352755pxb; Thu, 31 Mar 2022 07:01:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7qTvrAX4dOquAyGsM5yZU75/1Cr3pJ50ut9Y6FRbnmpzbINzvsy8PDcKykw2EFmlqAjZV X-Received: by 2002:a17:902:a98a:b0:155:fc0b:f1a with SMTP id bh10-20020a170902a98a00b00155fc0b0f1amr5497440plb.21.1648735272528; Thu, 31 Mar 2022 07:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648735272; cv=none; d=google.com; s=arc-20160816; b=jtE6HdQ4xeFWYZPg5MOfofgWuLl+ee61L5A9vAXdOl6/Wp4VxUBTXjrHuHXV1XgrRs 409jUIXkb3Tl/s5szRdYfATG0e6SH0KHoIr+w+H7WYZs/Z6UmBDRdYLNREX/FBQ0U2QS defWQqeUsJVg1Hm0YfHWyDowAYmsnucyAs4/UTT5VQdkn+0lK0wSA0iJFywh8C11s1Fy KfrW+O/H59shs4auKRfB2jo9Dw3fgG5Weohxxz+Y8efoI//O0DpQM5xSS9d2FsPxcO3q y7iOtG2CIxKIBLYmpak0mR5AgC3vcIwwJrzXCxMTI1zgsBARhRNRPPryBUG2JPPweFPk ephA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=NMQVoqz8SfXu3R+VsBdmsDlrmeRodfJEqBfILKUa0d0=; b=aEGPky5C6/1QhYVZxdl4FuE8E7pF6LrRATuL81E7cWcOekzprrf/i0aM1trsl8ZjiW Jyq+8JGcPdNOxESegc4c/LlKlFI7c2DrKJydtqhfCzt5c26EAPfEbnj7SjysDcRigbty IAlb4lNK3wzzZYu4UJiux23u+B6ZIreOUmXbZkqb3ZhrIMmHwd5c6QqscT5zRhaN5gVn Jqbw/MB+2Mc+Q6z15fDjlGH2VsLemE5zGaTVsFpR7m74vF1Sw8xl28HNVDWIEv/Y4bIb fkC7t2Y+OO7+jCMTJTbFTqpCCRjbbk0GLzO0X80gZ/ppQTo1csbcvQ1nR4cn95PNomWO VlaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y4-20020a17090ad0c400b001c6953a47c9si2931500pjw.151.2022.03.31.07.00.53; Thu, 31 Mar 2022 07:01:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236058AbiCaM1i (ORCPT + 99 others); Thu, 31 Mar 2022 08:27:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbiCaM1h (ORCPT ); Thu, 31 Mar 2022 08:27:37 -0400 Received: from gateway31.websitewelcome.com (gateway31.websitewelcome.com [192.185.143.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8110A20C1A1 for ; Thu, 31 Mar 2022 05:25:50 -0700 (PDT) Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 0057E83680 for ; Thu, 31 Mar 2022 07:25:49 -0500 (CDT) Received: from gator4132.hostgator.com ([192.185.4.144]) by cmsmtp with SMTP id Zts5nhvgkb6UBZts5nkMZY; Thu, 31 Mar 2022 07:25:49 -0500 X-Authority-Reason: nr=8 Received: from host-79-43-204-123.retail.telecomitalia.it ([79.43.204.123]:33842 helo=[10.0.0.45]) by gator4132.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nZts5-003e8f-63; Thu, 31 Mar 2022 07:25:49 -0500 Message-ID: <2afd6cba-1a01-0c32-eae8-c4f9f7e76732@kernel.org> Date: Thu, 31 Mar 2022 14:25:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] rtla/osnoise: fix NULL but dereferenced coccicheck errors Content-Language: en-US To: Wan Jiabing Cc: kael_w@qq.com, Steven Rostedt , linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220322113253.57390-1-wanjiabing@vivo.com> From: Daniel Bristot de Oliveira In-Reply-To: <20220322113253.57390-1-wanjiabing@vivo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4132.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - kernel.org X-BWhitelist: no X-Source-IP: 79.43.204.123 X-Source-L: No X-Exim-ID: 1nZts5-003e8f-63 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: host-79-43-204-123.retail.telecomitalia.it ([10.0.0.45]) [79.43.204.123]:33842 X-Source-Auth: kernel@bristot.me X-Email-Count: 1 X-Source-Cap: YnJpc3RvdG1lO2JyaXN0b3RtZTtnYXRvcjQxMzIuaG9zdGdhdG9yLmNvbQ== X-Local-Domain: no X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Wan On 3/22/22 12:32, Wan Jiabing wrote: > Fix the following coccicheck errors: > ./tools/tracing/rtla/src/osnoise_hist.c:870:31-36: ERROR: record is NULL but dereferenced. > ./tools/tracing/rtla/src/osnoise_top.c:650:31-36: ERROR: record is NULL but dereferenced. > > "record" is NULL before calling osnoise_init_trace_tool. > Add a tag "out_free" to avoid dereferring a NULL pointer. Yes, I see the problem. Please, change the Subject to something with better information about the problem, instead of the way you fund it. > Fixes: 51d64c3a1819 ("rtla: Add -e/--event support") > Signed-off-by: Wan Jiabing > --- > tools/tracing/rtla/src/osnoise_hist.c | 5 +++-- > tools/tracing/rtla/src/osnoise_top.c | 9 +++++---- > 2 files changed, 8 insertions(+), 6 deletions(-) Please, also add the version of coccicheck you are using, because it seems that there is a problem with it. There is a similar problem with timerlat, added by the same patch, but it seems that coccicheck did not find it. Would you mind to check coccicheck, and also add the fix for timerlat? Thanks. -- Daniel