projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
068ad41
)
misc/ics932s401: Add a missing check to i2c_smbus_read_word_data
author
Aditya Pakki
<pakki001@umn.edu>
Mon, 24 Dec 2018 17:31:13 +0000
(11:31 -0600)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 18 Jan 2019 15:34:06 +0000
(16:34 +0100)
ics932s401_update_device may fail reading in i2c_smbus_read_word_data
due to error in i2c_smbus_xfer. The fix checks the status and defaults
the register to 0.
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/ics932s401.c
patch
|
blob
|
history
diff --git
a/drivers/misc/ics932s401.c
b/drivers/misc/ics932s401.c
index 81a0541ef3ac8a2b24fcd4902853329a57dcc2ac..294fb2f66bfebebdb8a0d6392c3ca659477a996e 100644
(file)
--- a/
drivers/misc/ics932s401.c
+++ b/
drivers/misc/ics932s401.c
@@
-146,6
+146,8
@@
static struct ics932s401_data *ics932s401_update_device(struct device *dev)
*/
for (i = 0; i < NUM_MIRRORED_REGS; i++) {
temp = i2c_smbus_read_word_data(client, regs_to_copy[i]);
+ if (temp < 0)
+ data->regs[regs_to_copy[i]] = 0;
data->regs[regs_to_copy[i]] = temp >> 8;
}