diff options
author | Mario Limonciello <mario.limonciello@dell.com> | 2017-09-14 08:41:55 +0200 |
---|---|---|
committer | Darren Hart (VMware) <dvhart@infradead.org> | 2017-09-23 00:08:19 +0200 |
commit | 12933ea2b8c1e1f87a5dfece947325ee9e6d65b0 (patch) | |
tree | 15afbc2cdf10308df39b16eaccbd07e38bd004c5 | |
parent | platform/x86: intel_telemetry_debugfs: Use standard ARRAY_SIZE() macro (diff) | |
download | linux-12933ea2b8c1e1f87a5dfece947325ee9e6d65b0.tar.xz linux-12933ea2b8c1e1f87a5dfece947325ee9e6d65b0.zip |
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>
-rw-r--r-- | drivers/platform/x86/intel-wmi-thunderbolt.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/platform/x86/intel-wmi-thunderbolt.c b/drivers/platform/x86/intel-wmi-thunderbolt.c index 32fb6cc33d72..c2257bd06f18 100644 --- a/drivers/platform/x86/intel-wmi-thunderbolt.c +++ b/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) { status = wmi_evaluate_method(INTEL_WMI_THUNDERBOLT_GUID, 0, 1, &input, NULL); - if (ACPI_FAILURE(status)) { - pr_err("intel-wmi-thunderbolt: failed setting %s\n", - buf); + if (ACPI_FAILURE(status)) return -ENODEV; - } } else { - pr_err("intel-wmi-thunderbolt: unsupported mode: %d", mode); + return -EINVAL; } return count; } |