Skip to content

Commit 980f481

Browse files
Mario Limonciellodvhart
authored andcommitted
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 <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
1 parent f97e058 commit 980f481

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/platform/x86/dell-smbios.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,15 @@ static void __init find_tokens(const struct dmi_header *dm, void *dummy)
172172

173173
static int __init dell_smbios_init(void)
174174
{
175+
const struct dmi_device *valid;
175176
int ret;
176177

178+
valid = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL);
179+
if (!valid) {
180+
pr_err("Unable to run on non-Dell system\n");
181+
return -ENODEV;
182+
}
183+
177184
dmi_walk(find_tokens, NULL);
178185

179186
if (!da_tokens) {

0 commit comments

Comments
 (0)