ACK: [PATCH 1/1] UBUNTU: SAUCE: ACPI / bus: Fix NULL pointer dereference in acpi_quirk_matches_bios_ids()
Connor Kuehl
connor.kuehl at canonical.com
Thu Jul 11 17:39:55 UTC 2019
On 7/9/19 4:11 AM, Kai-Heng Feng wrote:
> BugLink: https://bugs.launchpad.net/bugs/1829378
>
> Bail out early when either bios_vendor or bios_ver is NULL.
>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng at canonical.com>
Acked-by: Connor Kuehl <connor.kuehl at canonical.com>
> ---
> drivers/acpi/bus.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> index 0b306a7cef77..159c79756bb4 100644
> --- a/drivers/acpi/bus.c
> +++ b/drivers/acpi/bus.c
> @@ -121,7 +121,10 @@ bool acpi_quirk_matches_bios_ids(const char * const ids[])
> const char *bios_ver = dmi_get_system_info(DMI_BIOS_VERSION);
> int i;
>
> - if ((!bios_vendor) && (!bios_ver) && strncmp(bios_vendor, "LENOVO", 6))
> + if (!bios_vendor || !bios_ver)
> + return false;
> +
> + if (strncmp(bios_vendor, "LENOVO", 6))
> return false;
>
> for (i = 0; ids[i]; i++)
>
More information about the kernel-team
mailing list