Skip to content

Commit 4c4a3d7

Browse files
MatanZjwrdegoede
authored andcommitted
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>
1 parent 349bff4 commit 4c4a3d7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/platform/x86/lg-laptop.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ static int acpi_add(struct acpi_device *device)
655655
goto out_platform_registered;
656656
}
657657
product = dmi_get_system_info(DMI_PRODUCT_NAME);
658-
if (strlen(product) > 4)
658+
if (product && strlen(product) > 4)
659659
switch (product[4]) {
660660
case '5':
661661
case '6':

0 commit comments

Comments
 (0)