Skip to content
Commit ef5899e5 authored by Tristan Honscheid's avatar Tristan Honscheid Committed by Fabio Baltieri
Browse files

sensors: max17262: Error-check init I2C operations



The init function of the MAX17262 sensor doesn't check the return value
of its I2C read and write functions. In case a read operation fails, the
output variable is not updated but the driver proceeds anyways. This can
cause unintended operation due to the potentially un-initialized memory,
such as getting stuck in the polling loop on line max17262.c:245. Update
the init function to abort and pass along the error code when I2C
transactions fail.

Signed-off-by: default avatarTristan Honscheid <honscheid@google.com>
parent 9aa0d0f5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment