aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/psmouse-base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse/psmouse-base.c')
-rw-r--r--drivers/input/mouse/psmouse-base.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index f5a6be1d3c46..9fcb00b8e1a2 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1433,10 +1433,8 @@ static ssize_t psmouse_set_int_attr(struct psmouse *psmouse, void *offset, const
1433{ 1433{
1434 unsigned int *field = (unsigned int *)((char *)psmouse + (size_t)offset); 1434 unsigned int *field = (unsigned int *)((char *)psmouse + (size_t)offset);
1435 unsigned long value; 1435 unsigned long value;
1436 char *rest;
1437 1436
1438 value = simple_strtoul(buf, &rest, 10); 1437 if (strict_strtoul(buf, 10, &value))
1439 if (*rest)
1440 return -EINVAL; 1438 return -EINVAL;
1441 1439
1442 if ((unsigned int)value != value) 1440 if ((unsigned int)value != value)
@@ -1549,10 +1547,8 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, co
1549static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, void *data, const char *buf, size_t count) 1547static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, void *data, const char *buf, size_t count)
1550{ 1548{
1551 unsigned long value; 1549 unsigned long value;
1552 char *rest;
1553 1550
1554 value = simple_strtoul(buf, &rest, 10); 1551 if (strict_strtoul(buf, 10, &value))
1555 if (*rest)
1556 return -EINVAL; 1552 return -EINVAL;
1557 1553
1558 psmouse->set_rate(psmouse, value); 1554 psmouse->set_rate(psmouse, value);
@@ -1562,10 +1558,8 @@ static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, void *data, const
1562static ssize_t psmouse_attr_set_resolution(struct psmouse *psmouse, void *data, const char *buf, size_t count) 1558static ssize_t psmouse_attr_set_resolution(struct psmouse *psmouse, void *data, const char *buf, size_t count)
1563{ 1559{
1564 unsigned long value; 1560 unsigned long value;
1565 char *rest;
1566 1561
1567 value = simple_strtoul(buf, &rest, 10); 1562 if (strict_strtoul(buf, 10, &value))
1568 if (*rest)
1569 return -EINVAL; 1563 return -EINVAL;
1570 1564
1571 psmouse->set_resolution(psmouse, value); 1565 psmouse->set_resolution(psmouse, value);