From patchwork Fri Oct 13 07:42:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 152359 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1723361vqb; Fri, 13 Oct 2023 00:43:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF2vWjPmh7Ag1U3KvsYE6lCz96E517djBvuQ3dU/6xobrWV2zmkSbD0iLIWdgsjqXJTKb4f X-Received: by 2002:a17:90b:4d86:b0:27c:fd8d:164a with SMTP id oj6-20020a17090b4d8600b0027cfd8d164amr7885248pjb.1.1697183014586; Fri, 13 Oct 2023 00:43:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697183014; cv=none; d=google.com; s=arc-20160816; b=n4qHAbEn2g27MViu4n02bTCTaagdLfE1JuxY0fPTWKOvs1dcNVCsCN7xxnrjup+k7d 0Xl9HFaIhoqld2IH1tBP1LsNPl6wYKBkhpDdJ4uoplHV5HKAyFIGHJTjPNTy46ZSjktE xdSG1aE+jIdssFsUYLyp2EeOBgPrldJuGJYgVR3YndKbqw/ziQ+m5zei8iMd8oDdnsLv begKBI+5RtlZ8eNn5/JM2RCVVJf/f5swE1mKuof6jVH+hXxpcngE9FaYzVx08KehpBBL yDdIGQbcDNmmFYolIJEiRIl0qgeVs14d2aDSRtN+yuGb6Rht2RxnqxOJDzd4TulURXJV 5E6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=iXCw9IkWlk0gd+BE15eTwbCAJMYeblimrkybqcODQ5A=; fh=GRCiVKHX+DxQTkdvozCoM96pETaZoYrwlA1QXHU4byU=; b=Q6uPHFjewrWwKIJuifCOHCR2HpqglAWOboyYgN6Ws/YGIQh2oiFME/0QclbbLFIiOf /sPbMrFiyvzKvC8NLe4rVn6N+7tCAykuAPgK41c3Hx2JuHhH7uR12WKcJzzP4YoXQvfT LrKn/udsXA05TdLi0Vrd79EmnSUTh0GH5meROwZxM94OubGhng4Wx4mikODELMzv7mJG 2qhAWJ3XGD3L2+ivYnuZErsQW/7B9y9kytf32LvwGKN1r+r4poTjJWOxHdUsldMf/w5I s23sOy8IaQDnExyO73P5eFVtbhfGO02RqoJ+jPPqiN19DtMlAbz+pF77AztFacBcEYPz BsMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vOWQZ2HV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=R9PsJqev; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id h2-20020a17090ac38200b0027d097b9c36si3924503pjt.75.2023.10.13.00.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:43:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vOWQZ2HV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=R9PsJqev; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 50F2B829E932; Fri, 13 Oct 2023 00:43:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229903AbjJMHnP (ORCPT + 19 others); Fri, 13 Oct 2023 03:43:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbjJMHnN (ORCPT ); Fri, 13 Oct 2023 03:43:13 -0400 Received: from galois.linutronix.de (unknown [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 021D6B8; Fri, 13 Oct 2023 00:43:10 -0700 (PDT) Date: Fri, 13 Oct 2023 07:42:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697182974; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iXCw9IkWlk0gd+BE15eTwbCAJMYeblimrkybqcODQ5A=; b=vOWQZ2HVJve7Q7G4FKO1RF4VhTJw5c2C2c4o+mA5cSrJ4HsAU6GKQL52NIHC4XAahlT7g2 yD3xWSymfAPFXqMWMrwJk5S2ia1FDBnMslyJ5m3kw/GAdQFONsjU51DYTbckxYGkAyZlz9 EHJxBfnpVMI5zcoGfs+NAiF46KSzYQIqHAi4jII3owqvtki+c4pU6S0oiJuS5F+kYzRGqX G9vyMDgtB+Hh7Xx8TwMT2dzQli/kxZthtJFHdRx5692MkI98ojB3uo2AcZ+icKrCpnt/oG t+sDHrTyvrPGoHteshZRL43IfGtvyy4qKunXrcBQ3I08ar9wJTloV/x0ZFvWKw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697182974; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iXCw9IkWlk0gd+BE15eTwbCAJMYeblimrkybqcODQ5A=; b=R9PsJqevuuCjd/Jh1qHhsJfbFTxS+V00pb8yqFn+XNEgFAMwwImUU3re+L2vlyetAM6xA3 SKFEzJ+WCQN03SDQ== From: "tip-bot2 for Dan Carpenter" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86/amd/uncore: Fix uninitialized return value in amd_uncore_init() Cc: Dan Carpenter , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <169718297336.3135.15401455533118971114.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 13 Oct 2023 00:43:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779625376750368558 X-GMAIL-MSGID: 1779625376750368558 The following commit has been merged into the perf/core branch of tip: Commit-ID: 7543365739a4ff61d40ad53ab68c17d2e7dfb0c9 Gitweb: https://git.kernel.org/tip/7543365739a4ff61d40ad53ab68c17d2e7dfb0c9 Author: Dan Carpenter AuthorDate: Fri, 13 Oct 2023 10:18:12 +03:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Oct 2023 09:32:50 +02:00 perf/x86/amd/uncore: Fix uninitialized return value in amd_uncore_init() Some of the error paths in this function return don't initialize the error code. Return -ENODEV by default. Fixes: d6389d3ccc13 ("perf/x86/amd/uncore: Refactor uncore management") Signed-off-by: Dan Carpenter Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/cec62eba-c4b8-4cb7-9671-58894dd4b974@moroto.mountain --- arch/x86/events/amd/uncore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c index 9b444ce..a389828 100644 --- a/arch/x86/events/amd/uncore.c +++ b/arch/x86/events/amd/uncore.c @@ -1009,7 +1009,8 @@ static struct amd_uncore uncores[UNCORE_TYPE_MAX] = { static int __init amd_uncore_init(void) { struct amd_uncore *uncore; - int ret, i; + int ret = -ENODEV; + int i; if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD && boot_cpu_data.x86_vendor != X86_VENDOR_HYGON)