From patchwork Fri Oct 13 07:18:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 152351 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1714129vqb; Fri, 13 Oct 2023 00:18:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/Ozhbji9FWKJI5RPdzszroh4Ugij/cSOcOTgu+FiUff53qakGwFUf2Y11d2JQkJAf58JD X-Received: by 2002:a05:6870:164c:b0:1e9:e605:27a1 with SMTP id c12-20020a056870164c00b001e9e60527a1mr494796oae.2.1697181511398; Fri, 13 Oct 2023 00:18:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697181511; cv=none; d=google.com; s=arc-20160816; b=MwrOGz83EQk/jlbCFOv9efRg/wlYbbkKB2a8DJwrl8mB5iq+a4zrYT4V4tlGZUrO7r HQlgwBwkAQR+acnDAlygmwpmjwUezTSsjuqdW75/vIqoQ4maVLIkzyLBM+55neq8DHaq 0eZGXVcZLceRHoYUNXqOa54+KeyVyvuhVqlv3C6vhr5izg5mBemRu+3ByRMwKbQZe0jl pB5noNY3x9jpcEywMOO3ytTTLzgJh6XMM3VL+znOst/8Nj6ZpjAD5+sqdhbv8hzsQCZk YVTa1z62az6ayn5ceeURFdghQ8R2n1Raxt1TFD9ov6xvFi/9aTW/N6JN/OKn2HQuv7TR 2Uqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=tbVF/4xx0+0vu2fMTNsv16S5m/ukxWZpS5bYJMmX8qM=; fh=hVoVKA2d8B+pivCukHr+P7n7LqwreztFu46bT8cOO4I=; b=qiyrUqN6vzkygcF40+hhH6tBW4B+GSab4Q50aOmcYlC3udPZlMvW7/eHyDI7QykckY uYTn4mHZp3wa8C5Z0VtOFTLJtiJbQH5AkJSZQprf8V2tRxDR1Dhla4MZ8Fos7GXoKqhZ p/biTV7gbCfNIve+uwSji25eW11s0rNbLSuqvXsSV7o/XcAfOzHns0GGMKUO+myyuRvA 3dtclHohoQRdzwX8zz2YYInxJPLD24NqNNHpVVkyMs/HsZarUMuGOeWGxowytbG/I9Bt wv6E2OapG0ZhGD8h9D8lhLF9pJlTRHkJQtHtLCZz70iaHQY7Fg0P8UqUQeRGkMa3gZWd vgLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fQHUhy3v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id a21-20020a63e855000000b0054405623a4asi1559883pgk.615.2023.10.13.00.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:18:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fQHUhy3v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 59EAC82B2E96; Fri, 13 Oct 2023 00:18:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229699AbjJMHSV (ORCPT + 19 others); Fri, 13 Oct 2023 03:18:21 -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 S229688AbjJMHSU (ORCPT ); Fri, 13 Oct 2023 03:18:20 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B9AFB8 for ; Fri, 13 Oct 2023 00:18:17 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-32d9b507b00so363718f8f.1 for ; Fri, 13 Oct 2023 00:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697181496; x=1697786296; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=tbVF/4xx0+0vu2fMTNsv16S5m/ukxWZpS5bYJMmX8qM=; b=fQHUhy3vDUanMdrmzzXVux/ic01wJ2iX9b/aUS3feozz+Q62J5P3f78MZYWrPV4e93 h4VM4iAZmmMqZomxPyD71xCjsghzDsANXlwyFgaX0V2JiN8FhMqgWMnYuB9ROf7uKEz2 9HNGVpZ9XxVDpTmWbJWc5CAOHWUeUGT3/p/WwpjZf3UIgww3spTtLpg7k0Pimswrfuxb YHGMYxQ7z3wM1Py/nCj0Hy6J+9Caq5JN43KL9QNzYWaLgwCs6PtcoZmy3NS/7xG/wWn8 C+o4KWGz7Xvc9/a5hRlJwiD5vZ3hPVuZwRBBLr1Pr4B/+GtRKZsCLmJS6P1Lxuhpfp0J 5MiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697181496; x=1697786296; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tbVF/4xx0+0vu2fMTNsv16S5m/ukxWZpS5bYJMmX8qM=; b=nFeGcqSvMg0dbNjPVN42GlPvytznvn4LZ/O0szcRoIl1xXGPwgtQB9hn6nrQgv8l4J HmLNNGkJpldj9zSqtdCzLyaaFnRXOQYVpm8OEWRCGoOf1XNmF/jewvn76V7dYyi54/58 hP407FQSbX3PUdn+lpN74QT8Vy8kKL1js9UMoMwbKVlIgbR7De4Tk9/WXO7zU+qNuUoA 6a++SnQJuDsGuI+KTNKTPsA/gJVMjt/sD7yDxol0ycxosHCyr+aTsYTpBLyxD3Rxkual KYXlhiJOg2wb4YpQm1Tf6xO2OvepKfj61UQnzXnyp7V/8uM8B20nYSC84TpP8uabXr48 1LMQ== X-Gm-Message-State: AOJu0Yz6TI8BjEMEDhqnVU+NIx2rlq5xC97beJ2y179EfzbTiZ5LhXM4 wQYuEpVlbubBBaFqEroFdrUaIBCX1ZvirliQ5oo= X-Received: by 2002:adf:e542:0:b0:31a:d4e1:ea30 with SMTP id z2-20020adfe542000000b0031ad4e1ea30mr22635389wrm.17.1697181495839; Fri, 13 Oct 2023 00:18:15 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id h12-20020adff18c000000b003232380ffd7sm20203133wro.102.2023.10.13.00.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:18:15 -0700 (PDT) Date: Fri, 13 Oct 2023 10:18:12 +0300 From: Dan Carpenter To: Sandipan Das Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] perf/x86/amd/uncore: fix error codes in amd_uncore_init() Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding 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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 13 Oct 2023 00:18:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779623800751572647 X-GMAIL-MSGID: 1779623800751572647 Some of the error paths in this function return don't initialize the error code. Return -ENODEV. Fixes: d6389d3ccc13 ("perf/x86/amd/uncore: Refactor uncore management") Signed-off-by: Dan Carpenter --- 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 9b444ce24108..a389828f378c 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)