kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Sun Ke <sunke32@huawei.com>, catalin.marinas@arm.com
Cc: mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	xueshuai@linux.alibaba.com
Subject: Re: [PATCH] drivers/perf: fix return value check in ali_drw_pmu_probe()
Date: Fri, 7 Oct 2022 14:15:32 +0100	[thread overview]
Message-ID: <20221007131531.GA26341@willie-the-truck> (raw)
In-Reply-To: <20220924032127.313156-1-sunke32@huawei.com>

On Sat, Sep 24, 2022 at 11:21:27AM +0800, Sun Ke wrote:
> In case of error, devm_ioremap_resource() returns ERR_PTR(),
> and never returns NULL. The NULL test in the return value
> check should be replaced with IS_ERR().
> 
> Fixes: cf7b61073e45 ("drivers/perf: add DDR Sub-System Driveway PMU driver for Yitian 710 SoC")
> Signed-off-by: Sun Ke <sunke32@huawei.com>
> ---
>  drivers/perf/alibaba_uncore_drw_pmu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/perf/alibaba_uncore_drw_pmu.c b/drivers/perf/alibaba_uncore_drw_pmu.c
> index 82729b874f09..a7689fecb49d 100644
> --- a/drivers/perf/alibaba_uncore_drw_pmu.c
> +++ b/drivers/perf/alibaba_uncore_drw_pmu.c
> @@ -658,8 +658,8 @@ static int ali_drw_pmu_probe(struct platform_device *pdev)
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	drw_pmu->cfg_base = devm_ioremap_resource(&pdev->dev, res);
> -	if (!drw_pmu->cfg_base)
> -		return -ENOMEM;
> +	if (IS_ERR(drw_pmu->cfg_base))
> +		return PTR_ERR(drw_pmu->cfg_base);
>  
>  	name = devm_kasprintf(drw_pmu->dev, GFP_KERNEL, "ali_drw_%llx",
>  			      (u64) (res->start >> ALI_DRW_PMU_PA_SHIFT));

Acked-by: Will Deacon <will@kernel.org>

Catalin can pick this one up as a fix.

Cheers,

Will

  parent reply	other threads:[~2022-10-07 13:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-24  3:21 [PATCH] drivers/perf: fix return value check in ali_drw_pmu_probe() Sun Ke
2022-09-26  1:14 ` Shuai Xue
2022-10-07 13:15 ` Will Deacon [this message]
2022-10-07 16:44 ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221007131531.GA26341@willie-the-truck \
    --to=will@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=sunke32@huawei.com \
    --cc=xueshuai@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).