summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/huawei-wmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/huawei-wmi.c')
-rw-r--r--drivers/platform/x86/huawei-wmi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c
index 5837d1b8693d..26041d44286a 100644
--- a/drivers/platform/x86/huawei-wmi.c
+++ b/drivers/platform/x86/huawei-wmi.c
@@ -345,7 +345,7 @@ static int huawei_wmi_battery_set(int start, int end)
union hwmi_arg arg;
int err;
- if (start < 0 || end > 100)
+ if (start < 0 || end < 0 || start > 100 || end > 100)
return -EINVAL;
arg.cmd = BATTERY_THRESH_SET;