Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
iio: hid-sensors: Fix an error handling path in _hid_sensor_set_repor…
Browse files Browse the repository at this point in the history
…t_latency()

commit 3a29b84 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: 138bc79 ("iio: hid-sensor-hub: Implement batch mode")
Signed-off-by: Christophe JAILLET <[email protected]>
Acked-by: Srinivas Pandruvada <[email protected]>
Link: https://patch.msgid.link/c50640665f091a04086e5092cf50f73f2055107a.1727980825.git.christophe.jaillet@wanadoo.fr
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
tititiou36 authored and gregkh committed Oct 22, 2024
1 parent 464b967 commit b086e95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/common/hid-sensors/hid-sensor-trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit b086e95

Please sign in to comment.