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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0jC+B7K0uuE=wLi1hk+WATn5B8sSu6abSO00rYJ4ofRFw@mail.gmail.com>
Date:   Thu, 23 Jun 2022 15:25:55 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     huhai <15815827059@....com>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <lenb@...nel.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        huhai <huhai@...inos.cn>
Subject: Re: [PATCH] ACPI: LPSS: Fix missing check in register_device_clock

On Thu, Jun 23, 2022 at 3:21 PM huhai <15815827059@....com> wrote:
>
> From: huhai <huhai@...inos.cn>
>
> register_device_clock() misses a check for platform_device_register_simple().
> Add a check to fix it.
>
> Signed-off-by: huhai <huhai@...inos.cn>
> ---
>  drivers/acpi/acpi_lpss.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> index fbe0756259c5..c4d4d21391d7 100644
> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c
> @@ -422,6 +422,9 @@ static int register_device_clock(struct acpi_device *adev,
>         if (!lpss_clk_dev)
>                 lpt_register_clock_device();
>
> +       if (IS_ERR(lpss_clk_dev))
> +               return PTR_ERR(lpss_clk_dev);
> +

Why not use IS_ERR_OR_NULL() instead?

>         clk_data = platform_get_drvdata(lpss_clk_dev);
>         if (!clk_data)
>                 return -ENODEV;
> --
> 2.27.0
>
>
> No virus found
>                 Checked by Hillstone Network AntiVirus
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ