Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp782101rdg; Fri, 13 Oct 2023 00:18:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFxwbzfnB9/GaFT811ZUF4mpBfbnqKC2KfUusHwR9c7s33z2B9fdNfcPQ2M9mT2cHAosWoQ X-Received: by 2002:a17:902:db0d:b0:1c9:9573:69b3 with SMTP id m13-20020a170902db0d00b001c9957369b3mr15583439plx.30.1697181505598; Fri, 13 Oct 2023 00:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697181505; cv=none; d=google.com; s=arc-20160816; b=TP7QE0+Qzr/i6BOJOWffx+7UamU4Y79I19rNkzfOqlh8EuqCEkJ4+Foao3R9NNycUl fON1zgz7h03Ay5C3LqXUSXesQEI/lVDf0ckhRC4Egx5z80BHK7jIkG4iZYVmuY9+GocI bnMNoAG4dZedlNtZY/e21kTnpYtIy6yg1LueAwxt4rKtMl/9Dxv5SMQ3XlMqgO76ykZQ ujhXTU0yH/n+IT/TDAJ/5YNpwz87KgLOVqFserVAhpnoHzgp4F2A/nsdf2vHRJZKljnr gPnE2UL4NRj1iCKS5HY1b+i4paHfUEvedK2tLlcuBh4j6knauMq6wTFBzT3F1wEBz1ut Wnsg== 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:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y3-20020a170902ed4300b001c9e29d5d8asi2852298plb.112.2023.10.13.00.18.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 00:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; 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:7 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 snail.vger.email (Postfix) with ESMTP id 75A2682ECB1E; Fri, 13 Oct 2023 00:18:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229912AbjJMHSV (ORCPT + 99 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-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 13 Oct 2023 00:18:24 -0700 (PDT) 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) -- 2.39.2