Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4018654rwi; Sat, 22 Oct 2022 04:00:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM456DTbSUe9pZ7admqLLCbs4jBKxLoIY8vqg6fHv22tfV7wbzTZdzOOyHjCaAlHDQAsZ7jR X-Received: by 2002:a05:6402:2744:b0:45c:9978:eae8 with SMTP id z4-20020a056402274400b0045c9978eae8mr21936139edd.361.1666436405035; Sat, 22 Oct 2022 04:00:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666436405; cv=none; d=google.com; s=arc-20160816; b=JeH2PxZK6/i+WnEOypMCXspvL7yxATcg5uwi3ELGM0XrhffnU2I2y88jutQ92O+3IP jGCK9TNYCzv+ajx9Obkff/+rvKxAkVW3orWdXNkCapNHE4MZXVfud6zMheUYTcuImmpX MhHI9aAXjPp+5cVYVnDASHBS1cm3OZ3AfWDcgBySPqoFeTs9lb8cbrNsuu4wLNsQ6D71 NYWodZwBhqNFm/HoJXirprkXYvme0rn9wzD1b7+1jbMlVv0stn5Omi/lwoMgVO/SJxVx G4ckH2ergJy9i86o3JUP42bYkvJE0kWgUqUvH3OI1LKGty40fcPYtU7ODIVTzuks3l6/ T+UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=eGqWLhJfbn5Y82bqsMBxqAnrt8UWry+7Ga3wmJQRfI8=; b=W7w9MM6x2Kk+b5NnoD+TQiH4s/sqK7Fc2mKr+9240KFTEjlKIIiyFXH0PNVJYGjIzf Jb2Rot4+UHwHa5TyARtA/XhmDauaPYCAruQmXGfddf3ERqFiYdsR3Vyq+ZTIPflnZUJn AkE1+qfEZrPbnICXTawxCLYIJNqJrKKNfLBVRoFuslqoNJaxls9y0UfTca7pqSGBFVFz OUc5Mfot9QgQyIUqgAYlY1GG9uRcuONkofcMsOlh/gd2DrsrHcsGFDFD1uV4xthG0IqH ij5qdQiWZeleckbsr1qPH0a4sv971VjAITpCx9d+VoiYWmM4TqBhRnAElbEFaJ5OXJ4t PgZA== 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a170906974e00b007919388d2c6si15728701ejy.357.2022.10.22.03.59.39; Sat, 22 Oct 2022 04:00:05 -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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230106AbiJVKfV (ORCPT + 99 others); Sat, 22 Oct 2022 06:35:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbiJVKeu (ORCPT ); Sat, 22 Oct 2022 06:34:50 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07B5BAC388; Sat, 22 Oct 2022 02:51:30 -0700 (PDT) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MvbYb1tr3zmVBf; Sat, 22 Oct 2022 17:26:11 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 17:30:59 +0800 Received: from ubuntu1804.huawei.com (10.67.174.61) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 17:30:58 +0800 From: Yang Jihong To: , , , , , , , , , , CC: Subject: [PATCH 1/3] perf daemon: Check err before calling setup_server_config in __cmd_start Date: Sat, 22 Oct 2022 17:27:33 +0800 Message-ID: <20221022092735.114967-2-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT In-Reply-To: <20221022092735.114967-1-yangjihong1@huawei.com> References: <20221022092735.114967-1-yangjihong1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.174.61] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 If err!=0 before calling setup_server_config and reconfig==true, setup_server_config function may return 0 and err becomes 0. As a result, previous error is overwritten, need to check value of err first. Signed-off-by: Yang Jihong --- tools/perf/builtin-daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/builtin-daemon.c b/tools/perf/builtin-daemon.c index 6cb3f6cc36d0..b82bd902602a 100644 --- a/tools/perf/builtin-daemon.c +++ b/tools/perf/builtin-daemon.c @@ -1333,7 +1333,7 @@ static int __cmd_start(struct daemon *daemon, struct option parent_options[], if (fda.entries[signal_pos].revents & POLLIN) err = handle_signalfd(daemon) < 0; - if (reconfig) + if (!err && reconfig) err = setup_server_config(daemon); } } -- 2.30.GIT