lg-laptop: Correctly handle dmi_get_system_info() returning NULL

The laptop model is identified by parsing the product name. If no
product name is available, do not try to parse it.
Default model is 2017.

Signed-off-by: Matan Ziv-Av <matan@svgalib.org>
Link: https://lore.kernel.org/r/93ff3bb-503b-f73-bf18-87bae1699ed@svgalib.org
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Matan Ziv-Av 2021-08-29 15:07:08 +03:00 коммит произвёл Hans de Goede
Родитель 349bff48ae
Коммит 4c4a3d7cff
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -655,7 +655,7 @@ static int acpi_add(struct acpi_device *device)
goto out_platform_registered; goto out_platform_registered;
} }
product = dmi_get_system_info(DMI_PRODUCT_NAME); product = dmi_get_system_info(DMI_PRODUCT_NAME);
if (strlen(product) > 4) if (product && strlen(product) > 4)
switch (product[4]) { switch (product[4]) {
case '5': case '5':
case '6': case '6':