lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6ded068f5c004f8735dca378502b91ccdf56bc21.camel@icenowy.me>
Date: Fri, 26 Sep 2025 14:59:48 +0800
From: Icenowy Zheng <uwu@...nowy.me>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Drew Fustini <fustini@...nel.org>, Guo Ren <guoren@...nel.org>, Fu Wei
	 <wefu@...hat.com>, Ulf Hansson <ulf.hansson@...aro.org>, 
	linux-riscv@...ts.infradead.org, linux-pm@...r.kernel.org, 
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH next] pmdomain: thead: Fix error pointer vs NULL bug in
 th1520_pd_reboot_init()

在 2025-09-26星期五的 07:03 +0300,Dan Carpenter写道:
> The devm_auxiliary_device_create() returns NULL on error.  It never
> returns error pointers.  Using PTR_ERR_OR_ZERO() here means the

Checked the implementation of auxiliary devices, and this is true.

So

```
Acked-by: Icenowy Zheng <uwu@...nowy.me>
```

> 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@...aro.org>
> ---
>  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)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ