Browse Source

platform/x86: intel-wmi-thunderbolt: Silence error cases

These were raised by Lukas Wunner as potential DOS attacks against
the system log by passing bad data to sysfs.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Mario Limonciello 8 years ago
parent
commit
12933ea2b8
1 changed files with 2 additions and 5 deletions
  1. 2 5
      drivers/platform/x86/intel-wmi-thunderbolt.c

+ 2 - 5
drivers/platform/x86/intel-wmi-thunderbolt.c

@@ -41,13 +41,10 @@ static ssize_t force_power_store(struct device *dev,
 	if (mode == 0 || mode == 1) {
 	if (mode == 0 || mode == 1) {
 		status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1,
 		status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1,
 					     &input, NULL);
 					     &input, NULL);
-		if (ACPI_FAILURE(status)) {
-			pr_err("intel-wmi-thunderbolt: failed setting %s\n",
-			       buf);
+		if (ACPI_FAILURE(status))
 			return -ENODEV;
 			return -ENODEV;
-		}
 	} else {
 	} else {
-		pr_err("intel-wmi-thunderbolt: unsupported mode: %d", mode);
+		return -EINVAL;
 	}
 	}
 	return count;
 	return count;
 }
 }