From: Mario Limonciello Date: Thu, 14 Sep 2017 06:41:55 +0000 (-0500) Subject: platform/x86: intel-wmi-thunderbolt: Silence error cases X-Git-Tag: v4.15-rc1~41^2~71 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12933ea2b8c1e1f87a5dfece947325ee9e6d65b0;p=thirdparty%2Flinux.git 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 Signed-off-by: Darren Hart (VMware) --- diff --git a/drivers/platform/x86/intel-wmi-thunderbolt.c b/drivers/platform/x86/intel-wmi-thunderbolt.c index 32fb6cc33d723..c2257bd06f186 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; }