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: <CAJZ5v0jTqE+h3L3od2i7Y8xTTsKTz=26PQzVO8ZWugUJ0uhZDA@mail.gmail.com>
Date:   Mon, 7 Jun 2021 16:20:48 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Liu Shixin <liushixin2@...wei.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>
Subject: Re: [PATCH -next v2] ACPI: LPSS: Replaced simple_strtol() with kstrtol()

On Thu, Jun 3, 2021 at 10:39 AM Liu Shixin <liushixin2@...wei.com> wrote:
>
> The simple_strtol() function is deprecated in some situation since
> it does not check for the range overflow. Use kstrtol() instead.
>
> As the variables status and shared_host are valid only when the uid
> is not zero(default to zero). If uid_str is NULL or kstrtol() failed
> or uid is assigned to zero, related operations can be skipped.
>
> Signed-off-by: Liu Shixin <liushixin2@...wei.com>
> ---
> v1->v2: The previous description is inaccurate, so modified it.
>
>  drivers/acpi/acpi_lpss.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> index ca742f16a507..1b46e00cad3a 100644
> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c
> @@ -186,13 +186,12 @@ static void byt_i2c_setup(struct lpss_private_data *pdata)
>         long uid = 0;
>
>         /* Expected to always be true, but better safe then sorry */
> -       if (uid_str)
> -               uid = simple_strtol(uid_str, NULL, 10);
> -
> -       /* Detect I2C bus shared with PUNIT and ignore its d3 status */
> -       status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host);
> -       if (ACPI_SUCCESS(status) && shared_host && uid)
> -               pmc_atom_d3_mask &= ~(BIT_LPSS2_F1_I2C1 << (uid - 1));
> +       if (uid_str && !kstrtol(uid_str, 10, &uid)) {
> +               /* Detect I2C bus shared with PUNIT and ignore its d3 status */
> +               status = acpi_evaluate_integer(handle, "_SEM", NULL, &shared_host);
> +               if (ACPI_SUCCESS(status) && shared_host && uid)
> +                       pmc_atom_d3_mask &= ~(BIT_LPSS2_F1_I2C1 << (uid - 1));
> +       }
>
>         lpss_deassert_reset(pdata);
>
> --

I've applied this as 5.14 material, but I made some changes to it,
including a subject and changelog rewrite.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ