Linux Power Management development
 help / color / mirror / Atom feed
From: "Zhang, Rui" <rui.zhang@intel.com>
To: "dan.carpenter@linaro.org" <dan.carpenter@linaro.org>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] powercap: intel_rapl: Fix a NULL vs IS_ERR() bug
Date: Tue, 6 Jun 2023 08:56:45 +0000	[thread overview]
Message-ID: <8e34bb46e770408efd5b207fb293af7c06832a94.camel@intel.com> (raw)
In-Reply-To: <ZH7s0qNJ8a/KHjvQ@moroto>

On Tue, 2023-06-06 at 11:22 +0300, Dan Carpenter wrote:
> The devm_ioremap_resource() function returns error pointers on error,
> it never returns NULL.  Update the check accordingly.
> 
> Fixes: 9eef7f9da928 ("powercap: intel_rapl: Introduce RAPL TPMI
> interface driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Acked-by: Zhang Rui <rui.zhang@intel.com>

thanks,
rui
> ---
>  drivers/powercap/intel_rapl_tpmi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/powercap/intel_rapl_tpmi.c
> b/drivers/powercap/intel_rapl_tpmi.c
> index c016127b3497..4f4f13ded225 100644
> --- a/drivers/powercap/intel_rapl_tpmi.c
> +++ b/drivers/powercap/intel_rapl_tpmi.c
> @@ -255,8 +255,8 @@ static int intel_rapl_tpmi_probe(struct
> auxiliary_device *auxdev,
>         }
>  
>         trp->base = devm_ioremap_resource(&auxdev->dev, res);
> -       if (!trp->base) {
> -               ret = -ENOMEM;
> +       if (IS_ERR(trp->base)) {
> +               ret = PTR_ERR(trp->base);
>                 goto err;
>         }
>  


  reply	other threads:[~2023-06-06  8:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06  8:22 [PATCH] powercap: intel_rapl: Fix a NULL vs IS_ERR() bug Dan Carpenter
2023-06-06  8:56 ` Zhang, Rui [this message]
2023-06-12 17:52   ` Rafael J. Wysocki

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=8e34bb46e770408efd5b207fb293af7c06832a94.camel@intel.com \
    --to=rui.zhang@intel.com \
    --cc=dan.carpenter@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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