ACK: [PATCH 1/1] UBUNTU: SAUCE: ACPI / bus: Fix NULL pointer dereference in acpi_quirk_matches_bios_ids()

Kleber Souza kleber.souza at canonical.com
Wed Jul 10 13:30:30 UTC 2019


On 09.07.19 13:11, 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: Kleber Sacilotto de Souza <kleber.souza at canonical.com>

Thank you,
Kleber

> ---
>  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