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:
ebdcc81
)
hwmon: (abituguru3) Fix I/O error handling
author
Jean Delvare
<
[email protected]
>
Thu, 12 Mar 2009 12:36:38 +0000
(13:36 +0100)
committer
Jean Delvare
<
[email protected]
>
Thu, 12 Mar 2009 12:36:38 +0000
(13:36 +0100)
Fix a logic bug reported by Roel Kluin, by rewriting the error
handling code in a clearer way.
Signed-off-by: Jean Delvare <
[email protected]
>
Cc: Roel Kluin <
[email protected]
>
Acked-by: Alistair John Strachan <
[email protected]
>
Acked-by: Hans de Goede <
[email protected]
>
drivers/hwmon/abituguru3.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/abituguru3.c
b/drivers/hwmon/abituguru3.c
index e52b38806d034f4ac835bf626907d933f368a3de..ad2b3431b7253091505e726a72d4857b6f708dde 100644
(file)
--- a/
drivers/hwmon/abituguru3.c
+++ b/
drivers/hwmon/abituguru3.c
@@
-760,8
+760,11
@@
static int abituguru3_read_increment_offset(struct abituguru3_data *data,
for (i = 0; i < offset_count; i++)
if ((x = abituguru3_read(data, bank, offset + i, count,
- buf + i * count)) != count)
- return i * count + (i && (x < 0)) ? 0 : x;
+ buf + i * count)) != count) {
+ if (x < 0)
+ return x;
+ return i * count + x;
+ }
return i * count;
}