From patchwork Wed Sep 11 07:39:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13799841 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DBB8EEE0211 for ; Wed, 11 Sep 2024 07:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=7Vm+jEHhLAKPjaWuMJ4d76NlcE1THre8Dm/y67wAWD4=; b=bq3BgduBXncbc1AGACSpoBeBMV suXcxYRHvojG10OpNYV28SOhG8P5p3cU48Vx8N/nszlLU0SXqVuTyBJzLXkRmCj+y2tQrP5wfNpm+ 4ELVKtxDugiWFG4r/To4MdMf7Gb7cBeBQqwAxvPdQA+ZV9tIU10fOSUW3+Go9I3LSc1KGacBS5YdB Pk3+Io+XB2ZNSHWuvzz8qLIA5BaNCrbsi/LmO5YJFeSuOvrf+2Tj9ZxxW4/FKFDFdCwM36sMWucDO ZolqwRNTjaKwx8jbci9WgOtH/5mOGJOhT2Pkj2VBTO7a3zRj0Umpxpdy6ExeLYUJtdbrd+G/PsjZ6 GoyDzMVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1soI1q-00000008V4j-24bP; Wed, 11 Sep 2024 07:44:42 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1soHxM-00000008U2l-3EeT for linux-arm-kernel@lists.infradead.org; Wed, 11 Sep 2024 07:40:06 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42cb1758e41so34439045e9.1 for ; Wed, 11 Sep 2024 00:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726040403; x=1726645203; darn=lists.infradead.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=7Vm+jEHhLAKPjaWuMJ4d76NlcE1THre8Dm/y67wAWD4=; b=S0yGl1Q6VQgj6CwtOrNbWgZX7cfF59jL0xwumf6i4Ox95lf0LRv4AZO02pY3slzXet 7BqXK9ygyEUJlkDCAH3LCG6I6GzKNxMGaILoZQEmkm1t3LZGvQk3kXdkyFNCOKjryabe CqJBD+HHAiZvo7KLwkw/WDX9wwxE24ruXNNpDTfzjy7eBicehug7Z3zT2CzKCDaiQwq8 7F9u+lUKUd1p5PkkR3UXmGm/ctrjt8J5Xx//K7FKWCpYpqdlNIh5cJv2nqlGu85T903G 5fUWMcoybn7YU6yOPO8J9mmuPDpVwEoa6FP3rBppt96B0zcVWoeeQN90tJlbTa3kFTPB mW3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726040403; x=1726645203; 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=7Vm+jEHhLAKPjaWuMJ4d76NlcE1THre8Dm/y67wAWD4=; b=vP8sKG4OM9KtGUBN8eFjIxgCgkcgYgrht/k9Dn2Wb+nETVnwyuCAQsOVYWXP/SEcHI ODwzqCyW75HWGRci/g6ebibScfwoEK82ZL+5xYJhsyvd7v1cYqoEbVM5cKFy24FPdQRT mLxtk++nhqtG+mU0EOcHzy+xITJg5RPHEuNB9mvo5Hfne9OvAmSzC8qX9mC8ws4PAk8k PmATadX4Id6M6DxlbGlLNmJ42mTy0KxslLScN5E2ABoY8XvPs0wiuWrJOzj9NcXIlT5G arWhavEkDb4BE4Zic1AoGmJrYxKbo928CBPgh7B158p44vheTGwbjrW345KuZHBQHhrt 7VAA== X-Forwarded-Encrypted: i=1; AJvYcCUZCnyZxejlaeOM6LpMdJ/8+RWU5Z6Q7BQUgwBedgDfp8jt/eU4wi2YNyPb9EgfzRjt1i0xFJsXOXaKs44cwn6B@lists.infradead.org X-Gm-Message-State: AOJu0YwmobXGEoIiZlpX24/8uHcso+5M1UXetpsp7K2Hbu4vA7rLWOC1 JbTwUKJzXbPGgnIzEBgCJuMhN7R4u9mFLJbr4+eX4IYRY3KV6gqqNWX6s2Lh4jM= X-Google-Smtp-Source: AGHT+IHoNK+/nUMKYaelXKxN8yhTKmMxOo/BiZURjSF1S6UHYQvazTlTL0voyGPl2bhSF2Y66u2XRg== X-Received: by 2002:a5d:654e:0:b0:374:c87c:6653 with SMTP id ffacd0b85a97d-37894a6bdf2mr7336145f8f.59.1726040402949; Wed, 11 Sep 2024 00:40:02 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ca7cccd35sm151748545e9.18.2024.09.11.00.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 00:40:02 -0700 (PDT) Date: Wed, 11 Sep 2024 10:39:59 +0300 From: Dan Carpenter To: Robin Murphy Cc: Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH next] perf: arm-ni: Fix an NULL vs IS_ERR() bug Message-ID: <04d6ccc3-6d31-4f0f-ab0f-7a88342cc09a@stanley.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240911_004004_838036_F2B79089 X-CRM114-Status: GOOD ( 13.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The devm_ioremap() function never returns error pointers, it returns a NULL pointer if there is an error. Fixes: 4d5a7680f2b4 ("perf: Add driver for Arm NI-700 interconnect PMU") Signed-off-by: Dan Carpenter Reviewed-by: Robin Murphy --- drivers/perf/arm-ni.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/perf/arm-ni.c b/drivers/perf/arm-ni.c index b72df3aea93e..90fcfe693439 100644 --- a/drivers/perf/arm-ni.c +++ b/drivers/perf/arm-ni.c @@ -603,8 +603,8 @@ static int arm_ni_probe(struct platform_device *pdev) */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - if (IS_ERR(base)) - return PTR_ERR(base); + if (!base) + return -ENOMEM; arm_ni_probe_domain(base, &cfg); if (cfg.type != NI_GLOBAL)