Commit 379d7cfa authored by Dan Carpenter's avatar Dan Carpenter Committed by Dmitry Torokhov

Input: ff-core - silence an underflow warning

My static checker complains that "value" comes from the user in
evdev_do_ioctl() and we check that it's not too large here but we don't
check that it's negative.  It's harmless because the ->set_gain() and
->set_autocenter() functions truncate it to a valid u16 value, but we
may as well fix it just to make the static checker happy.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent b83b1459
...@@ -273,14 +273,14 @@ int input_ff_event(struct input_dev *dev, unsigned int type, ...@@ -273,14 +273,14 @@ int input_ff_event(struct input_dev *dev, unsigned int type,
switch (code) { switch (code) {
case FF_GAIN: case FF_GAIN:
if (!test_bit(FF_GAIN, dev->ffbit) || value > 0xffff) if (!test_bit(FF_GAIN, dev->ffbit) || value > 0xffffU)
break; break;
ff->set_gain(dev, value); ff->set_gain(dev, value);
break; break;
case FF_AUTOCENTER: case FF_AUTOCENTER:
if (!test_bit(FF_AUTOCENTER, dev->ffbit) || value > 0xffff) if (!test_bit(FF_AUTOCENTER, dev->ffbit) || value > 0xffffU)
break; break;
ff->set_autocenter(dev, value); ff->set_autocenter(dev, value);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment