]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: hid-sensors: Fix an error handling path in _hid_sensor_set_report_latency()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 3 Oct 2024 18:41:12 +0000 (20:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Oct 2024 13:40:44 +0000 (15:40 +0200)
commit 3a29b84cf7fbf912a6ab1b9c886746f02b74ea25 upstream.

If hid_sensor_set_report_latency() fails, the error code should be returned
instead of a value likely to be interpreted as 'success'.

Fixes: 138bc7969c24 ("iio: hid-sensor-hub: Implement batch mode")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://patch.msgid.link/c50640665f091a04086e5092cf50f73f2055107a.1727980825.git.christophe.jaillet@wanadoo.fr
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/common/hid-sensors/hid-sensor-trigger.c

index a4ec11a3b68a72ea49a94d864bee3084a3efaba8..82ab168cc13eab94667bf054ff9efc41f7dab287 100644 (file)
@@ -32,7 +32,7 @@ static ssize_t _hid_sensor_set_report_latency(struct device *dev,
        latency = integer * 1000 + fract / 1000;
        ret = hid_sensor_set_report_latency(attrb, latency);
        if (ret < 0)
-               return len;
+               return ret;
 
        attrb->latency_ms = hid_sensor_get_report_latency(attrb);