diff mbox

[v5,07/14] platform/x86: dell-smbios: only run if proper oem string is detected

Message ID 0b3a387ae29a0205106b5a1d741bbad5f684653f.1507350554.git.mario.limonciello@dell.com (mailing list archive)
State Changes Requested, archived
Delegated to: Darren Hart
Headers show

Commit Message

Limonciello, Mario Oct. 7, 2017, 4:59 a.m. UTC
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

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
 drivers/platform/x86/dell-smbios.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox


diff --git a/drivers/platform/x86/dell-smbios.c b/drivers/platform/x86/dell-smbios.c
index e9b1ca07c872..873d1c3f7641 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_info("Unable to run on non-Dell system\n");
+		return -ENODEV;
+	}
 	dmi_walk(find_tokens, NULL);
 	if (!da_tokens)  {