Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp393617imn; Wed, 27 Jul 2022 09:05:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tBG3Y+x8jKNBuMSXQqNRILDpSjlnowW1l8uTTSg3A9KqRm1z8qD9PpPeHfwf5urm7iT2ZN X-Received: by 2002:a17:90a:a40f:b0:1f2:f09:10e7 with SMTP id y15-20020a17090aa40f00b001f20f0910e7mr5575819pjp.73.1658937924733; Wed, 27 Jul 2022 09:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658937924; cv=none; d=google.com; s=arc-20160816; b=sUJI1xOTfiAlhZUQegGzMKWWG6sF2MAj+Qie2clFxjBmPZ2rqeK31VNAQBO/3EjbYU L7y7ElikWW2UuVoV+WAqo5ojhGrZ54sMylrovJfdOFgDZPavKOviPO9qQbZdsF4aYbaf 8KnyKIgXmos9OkdCIbM3G58xVXs05S7EpPVkpInDSrrNWwoZrGcDnIfPJzekPOzR8vzX vwcaHtCEmmoogfj7Oei/LIPtvadovDH84MITg+8Z/jjcxxdfEBtryiXRRDdXdmlnppyQ FAR3Nqud7IrhOrn+Nob8No54fgCIPBkpts+yAs4tzINbBaM3wi9Il5oMSrzx4h4pHHMY cglg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=1UZrPR5TR5lVdhFDTDmYcCVCY+u3FjTe0oshJ+G5LjE=; b=LBHWIwCAEivpbSNLOIPr5Rx3e9xnXveXXCi2bHh1GG6CSW/rMtCYLoNSKUZq9guRzi ePWSX+FJjihz3aBKkHZjou+VDUb57cRG3OK5xYZqg6/EdyUqiLJD5xZsT/CF8/EQyIO2 xzYmr47dW8PpolpiWYCLBEQ2Ip2nZbHx1hH2xCGIY8GpDycD5RamJy+tku9Tt7yCK+sE Y+hfcriuL4jjhc6eVBjLdwENt29qYrzkEJun49o3aZH8jDdJKOudXkZ/Kchb1dWuVcpP h+IayII+sBDLvq94lQEgkjuEe3FJQqI64+2Tjg3ipRs1GoOUZF5HliJz+LfkNk+MS0KT Uhiw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z6-20020a17090ab10600b001f1dba34ff4si2240942pjq.34.2022.07.27.09.05.07; Wed, 27 Jul 2022 09:05:24 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231922AbiG0PgO (ORCPT + 99 others); Wed, 27 Jul 2022 11:36:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229867AbiG0PgM (ORCPT ); Wed, 27 Jul 2022 11:36:12 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 75635237D9 for ; Wed, 27 Jul 2022 08:36:11 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 8C6CD1E80D54; Wed, 27 Jul 2022 23:36:18 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3y15_qWQBiFQ; Wed, 27 Jul 2022 23:36:16 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 698451E80D05; Wed, 27 Jul 2022 23:36:15 +0800 (CST) From: Li Qiong To: Steven Rostedt , Ingo Molnar Cc: linux-kernel@vger.kernel.org, yuzhe@nfschina.com, renyu@nfschina.com, jiaming@nfschina.com, Li Qiong Subject: [PATCH] tracing: Do PTR_ERR() after IS_ERR() Date: Wed, 27 Jul 2022 23:35:19 +0800 Message-Id: <20220727153519.6697-1-liqiong@nfschina.com> X-Mailer: git-send-email 2.11.0 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_NONE 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 Check IS_ERR() firstly, then do PTR_ERR(). Signed-off-by: Li Qiong --- kernel/trace/ring_buffer_benchmark.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/trace/ring_buffer_benchmark.c b/kernel/trace/ring_buffer_benchmark.c index 78e576575b79..a8f6b0725c45 100644 --- a/kernel/trace/ring_buffer_benchmark.c +++ b/kernel/trace/ring_buffer_benchmark.c @@ -439,17 +439,19 @@ static int __init ring_buffer_benchmark_init(void) if (!disable_reader) { consumer = kthread_create(ring_buffer_consumer_thread, NULL, "rb_consumer"); - ret = PTR_ERR(consumer); - if (IS_ERR(consumer)) + if (IS_ERR(consumer)) { + ret = PTR_ERR(consumer); goto out_fail; + } } producer = kthread_run(ring_buffer_producer_thread, NULL, "rb_producer"); - ret = PTR_ERR(producer); - if (IS_ERR(producer)) + if (IS_ERR(producer)) { + ret = PTR_ERR(producer); goto out_kill; + } /* * Run them as low-prio background tasks by default: -- 2.11.0