Thread (9 messages) 9 messages, 6 authors, 2021-05-13

Lifecycle

  1. Posted Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
  2. Reported-by Abaci Robot

[PATCH 2/2] HID: hid-sensor-custom: Process failure of sensor_hub_set_feature()

From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date: 2021-04-15 18:52:41
Also in: linux-iio, lkml
Subsystem: hid core layer, hid sensor hub drivers, the rest · Maintainers: Jiri Kosina, Benjamin Tissoires, Jonathan Cameron, Srinivas Pandruvada, Linus Torvalds

When user modifies a custom feature value and sensor_hub_set_feature()
fails, return error.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
Replaces patch: HID: hid-sensor-custom: remove useless variable
by Jiapeng Chong [off-list ref] 

 drivers/hid/hid-sensor-custom.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c
index 2628bc53ed80..58b54b127cdf 100644
--- a/drivers/hid/hid-sensor-custom.c
+++ b/drivers/hid/hid-sensor-custom.c
@@ -406,6 +406,8 @@ static ssize_t store_value(struct device *dev, struct device_attribute *attr,
 								report_id;
 		ret = sensor_hub_set_feature(sensor_inst->hsdev, report_id,
 					     index, sizeof(value), &value);
+		if (ret)
+			return ret;
 	} else
 		return -EINVAL;
 
-- 
2.27.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help