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:
55d512e
)
hwmon: (twl4030-madc-hwmon) Initialize uninitialized structure elements
author
Guenter Roeck
<
[email protected]
>
Tue, 19 Jun 2012 15:00:00 +0000
(08:00 -0700)
committer
Guenter Roeck
<
[email protected]
>
Wed, 12 Sep 2012 04:16:27 +0000
(21:16 -0700)
twl4030_madc_conversion uses do_avg and type structure elements of
twl4030_madc_request. Initialize structure to avoid random operation.
Fix for: Coverity CID 200794 Uninitialized scalar variable.
Cc: Keerthy <
[email protected]
>
Cc:
[email protected]
Signed-off-by: Guenter Roeck <
[email protected]
>
Acked-by: Jean Delvare <
[email protected]
>
Acked-by: Keerthy <
[email protected]
>
drivers/hwmon/twl4030-madc-hwmon.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/twl4030-madc-hwmon.c
b/drivers/hwmon/twl4030-madc-hwmon.c
index 0018c7dd0097de5045f646d98e715713ea7edba4..1a174f0a3cdeb9bd854d13fa61171a63c33e41d7 100644
(file)
--- a/
drivers/hwmon/twl4030-madc-hwmon.c
+++ b/
drivers/hwmon/twl4030-madc-hwmon.c
@@
-44,12
+44,13
@@
static ssize_t madc_read(struct device *dev,
struct device_attribute *devattr, char *buf)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- struct twl4030_madc_request req;
+ struct twl4030_madc_request req = {
+ .channels = 1 << attr->index,
+ .method = TWL4030_MADC_SW2,
+ .type = TWL4030_MADC_WAIT,
+ };
long val;
- req.channels = (1 << attr->index);
- req.method = TWL4030_MADC_SW2;
- req.func_cb = NULL;
val = twl4030_madc_conversion(&req);
if (val < 0)
return val;