Re: [PATCH] iio: hid-sensors: Fix poll_value sign check before msleep_interruptible
From: Andy Shevchenko
Date: Wed Jul 01 2026 - 11:49:41 EST
On Wed, Jul 01, 2026 at 10:43:19PM +0700, Kittisak Boonmapa wrote:
> hid_sensor_read_poll_value() returns -EINVAL when the HID descriptor
> does not contain a Report Interval feature field.
>
> _hid_sensor_power_state() currently treats any non-zero value as a
> valid delay and passes it to msleep_interruptible(). Since
> msleep_interruptible() takes an unsigned int, negative values are
> converted into very large delays.
>
> Only sleep when poll_value is positive.
Makes sense.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
--
With Best Regards,
Andy Shevchenko