diff options
-rw-r--r-- | drivers/platform/x86/oxpec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/oxpec.c b/drivers/platform/x86/oxpec.c index 4b48f4571b09..de70ca7e8493 100644 --- a/drivers/platform/x86/oxpec.c +++ b/drivers/platform/x86/oxpec.c @@ -582,7 +582,7 @@ static int oxp_psy_ext_set_prop(struct power_supply *psy, switch (psp) { case POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD: - if (val->intval > 100) + if (val->intval < 0 || val->intval > 100) return -EINVAL; return write_to_ec(OXP_X1_CHARGE_LIMIT_REG, val->intval); case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR: |