Missing error check of function sensor_trigger_set() #30189
Labels
area: Samples
Samples
area: Sensors
Sensors
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Hi,
As described in the project API documentation, function sensor_trigger_set() is used to activate a sensor's trigger and set the trigger handler. It returns 0 if successful, negative errno code if failure. But as shown in the following codes, the return value is not error checked before it is assigned by another function.
zephyr/samples/sensor/sht3xd/src/main.c
Lines 51 to 61 in 0a0404d
But, the return values of the function from other call sites are all checked. See the following code,
zephyr/samples/sensor/sm351lt/src/main.c
Lines 72 to 76 in 0a0404d
The text was updated successfully, but these errors were encountered: