]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
platform/x86: dell-smbios: only run if proper oem string is detected
authorMario Limonciello <mario.limonciello@dell.com>
Wed, 1 Nov 2017 19:25:29 +0000 (14:25 -0500)
committerDarren Hart (VMware) <dvhart@infradead.org>
Fri, 3 Nov 2017 23:33:58 +0000 (16:33 -0700)
The proper way to indicate that a system is a 'supported' Dell System
is by the presence of this string in OEM strings.

Allowing the driver to load on non-Dell systems will have undefined
results.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Reviewed-by: Edward O'Callaghan <quasisec@google.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
drivers/platform/x86/dell-smbios.c

index ffc174638aa4f9def4e74e14163e4ba7af3ac8a2..12a3eb1539115f93bf6d7523fdd78e9f2af3e4de 100644 (file)
@@ -172,8 +172,15 @@ static void __init find_tokens(const struct dmi_header *dm, void *dummy)
 
 static int __init dell_smbios_init(void)
 {
+       const struct dmi_device *valid;
        int ret;
 
+       valid = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL);
+       if (!valid) {
+               pr_err("Unable to run on non-Dell system\n");
+               return -ENODEV;
+       }
+
        dmi_walk(find_tokens, NULL);
 
        if (!da_tokens)  {