kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Icenowy Zheng <uwu@icenowy.me>, Drew Fustini <fustini@kernel.org>,
	Guo Ren <guoren@kernel.org>,  Fu Wei <wefu@redhat.com>,
	linux-riscv@lists.infradead.org, linux-pm@vger.kernel.org,
	 linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH next] pmdomain: thead: Fix error pointer vs NULL bug in th1520_pd_reboot_init()
Date: Fri, 26 Sep 2025 14:51:43 +0200	[thread overview]
Message-ID: <CAPDyKFq7mwW7ys6_1wnhf+BYBeDcsxgcL5HxGhnpxv1vMO2qaA@mail.gmail.com> (raw)
In-Reply-To: <aNYQkVuVpP3Daq7x@stanley.mountain>

On Fri, 26 Sept 2025 at 06:03, Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> The devm_auxiliary_device_create() returns NULL on error.  It never
> returns error pointers.  Using PTR_ERR_OR_ZERO() here means the function
> always returns success.  Replace the PTR_ERR_OR_ZERO() call check with
> a NULL check.
>
> Fixes: 64581f41f4c4 ("pmdomain: thead: create auxiliary device for rebooting")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Applied for next, thanks!

Kind regards
Uffe

> ---
>  drivers/pmdomain/thead/th1520-pm-domains.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pmdomain/thead/th1520-pm-domains.c b/drivers/pmdomain/thead/th1520-pm-domains.c
> index 5213994101a5..d7cb9633c7c8 100644
> --- a/drivers/pmdomain/thead/th1520-pm-domains.c
> +++ b/drivers/pmdomain/thead/th1520-pm-domains.c
> @@ -179,8 +179,10 @@ static int th1520_pd_reboot_init(struct device *dev,
>         struct auxiliary_device *adev;
>
>         adev = devm_auxiliary_device_create(dev, "reboot", aon_chan);
> +       if (!adev)
> +               return -ENODEV;
>
> -       return PTR_ERR_OR_ZERO(adev);
> +       return 0;
>  }
>
>  static int th1520_pd_probe(struct platform_device *pdev)
> --
> 2.51.0
>

      parent reply	other threads:[~2025-09-26 12:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-26  4:03 [PATCH next] pmdomain: thead: Fix error pointer vs NULL bug in th1520_pd_reboot_init() Dan Carpenter
2025-09-26  6:59 ` Icenowy Zheng
2025-09-26 12:51 ` Ulf Hansson [this message]

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=CAPDyKFq7mwW7ys6_1wnhf+BYBeDcsxgcL5HxGhnpxv1vMO2qaA@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=dan.carpenter@linaro.org \
    --cc=fustini@kernel.org \
    --cc=guoren@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=uwu@icenowy.me \
    --cc=wefu@redhat.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).