summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorMatan Ziv-Av <matan@svgalib.org>2021-08-29 15:07:08 +0300
committerHans de Goede <hdegoede@redhat.com>2021-09-13 11:38:52 +0300
commit4c4a3d7cffb42da21ea8891fc7e6808ae05dbcb5 (patch)
treea799ba7ef1dd22aed816bae17f519c9b39f9ff0c /drivers/platform
parent349bff48ae0f5f8aa2075d0bdc2091a30bd634f6 (diff)
downloadlinux-4c4a3d7cffb42da21ea8891fc7e6808ae05dbcb5.tar.xz
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>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/lg-laptop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
index 3e520d5bca07..88b551caeaaf 100644
--- a/drivers/platform/x86/lg-laptop.c
+++ b/drivers/platform/x86/lg-laptop.c
@@ -655,7 +655,7 @@ static int acpi_add(struct acpi_device *device)
goto out_platform_registered;
}
product = dmi_get_system_info(DMI_PRODUCT_NAME);
- if (strlen(product) > 4)
+ if (product && strlen(product) > 4)
switch (product[4]) {
case '5':
case '6':