Commit 4c4a3d7c authored by Matan Ziv-Av's avatar Matan Ziv-Av Committed by Hans de Goede

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: default avatarMatan Ziv-Av <matan@svgalib.org>
Link: https://lore.kernel.org/r/93ff3bb-503b-f73-bf18-87bae1699ed@svgalib.orgReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 349bff48
...@@ -655,7 +655,7 @@ static int acpi_add(struct acpi_device *device) ...@@ -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':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment