summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorMario Limonciello2017-11-01 20:25:29 +0100
committerDarren Hart (VMware)2017-11-04 00:33:58 +0100
commit980f481d63f57bb62ac171a66294de3e14d52b77 (patch)
tree4fdb3d568a714c02f04219a00c8c89099290543b /drivers/platform
parentplatform/x86: wmi: Don't allow drivers to get each other's GUIDs (diff)
downloadkernel-qcow2-linux-980f481d63f57bb62ac171a66294de3e14d52b77.tar.gz
kernel-qcow2-linux-980f481d63f57bb62ac171a66294de3e14d52b77.tar.xz
kernel-qcow2-linux-980f481d63f57bb62ac171a66294de3e14d52b77.zip
platform/x86: dell-smbios: only run if proper oem string is detected
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>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/dell-smbios.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/platform/x86/dell-smbios.c b/drivers/platform/x86/dell-smbios.c
index ffc174638aa4..12a3eb153911 100644
--- a/drivers/platform/x86/dell-smbios.c
+++ b/drivers/platform/x86/dell-smbios.c
@@ -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) {