diff options
author | Edward A. James <eajames@us.ibm.com> | 2017-10-26 23:15:13 +0300 |
---|---|---|
committer | Andrew Jeffery <andrew@aj.id.au> | 2017-10-27 00:16:46 +0300 |
commit | 5806148a26fdea2a972d70d0c35fbf7cae000250 (patch) | |
tree | dfb1b4dc01d94a8f6a5e768c7fd7a30627c824e5 | |
parent | ccbb1cf05ec2ad03d858610396f363ffaef10026 (diff) | |
download | linux-5806148a26fdea2a972d70d0c35fbf7cae000250.tar.xz |
drivers (hwmon): occ: Fix memory allocation for extended sensors
If extended sensors are present, the driver is doing bad memory access
since we weren't allocating enough memory for the extended sensors. Fix
this with proper allocation for extended sensor attributes.
OpenBMC-Staging-Count: 1
Signed-off-by: Edward A. James <eajames@us.ibm.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r-- | drivers/hwmon/occ/common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/occ/common.c b/drivers/hwmon/occ/common.c index 3b9adf42d2bb..3175e7b27cc9 100644 --- a/drivers/hwmon/occ/common.c +++ b/drivers/hwmon/occ/common.c @@ -872,7 +872,7 @@ int occ_setup_sensor_attrs(struct occ *occ) switch (sensors->extended.version) { case 1: - occ->num_attrs += sensors->extended.num_sensors; + occ->num_attrs += (sensors->extended.num_sensors * 3); break; default: sensors->extended.num_sensors = 0; |