diff options
Diffstat (limited to 'drivers/input/mouse/logips2pp.c')
-rw-r--r-- | drivers/input/mouse/logips2pp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c index faac2c3bef74..84de2fc6acc1 100644 --- a/drivers/input/mouse/logips2pp.c +++ b/drivers/input/mouse/logips2pp.c @@ -155,9 +155,14 @@ static ssize_t ps2pp_attr_show_smartscroll(struct psmouse *psmouse, static ssize_t ps2pp_attr_set_smartscroll(struct psmouse *psmouse, void *data, const char *buf, size_t count) { - unsigned long value; + unsigned int value; + int err; - if (strict_strtoul(buf, 10, &value) || value > 1) + err = kstrtouint(buf, 10, &value); + if (err) + return err; + + if (value > 1) return -EINVAL; ps2pp_set_smartscroll(psmouse, value); |