summaryrefslogtreecommitdiff
path: root/drivers/hwmon/nct6775.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-20 11:36:52 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-20 11:36:52 -0700
commit622f223488517f2b0a5a5e518b2a6c950cf0a2ee (patch)
tree6ee3fcb99e88c3fc8163561444a888ef842b1da9 /drivers/hwmon/nct6775.c
parent5e427ec2d066b48a5c27b3a5a3315f7e4e729077 (diff)
parent917cc4e6b25c655264e8ea903eb77db25994ac24 (diff)
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fixes from Guenter Roeck: - Error path fixes for abituguru and iio_hwmon drivers. - Drop erroneously created attributes from nct6775 driver. - Drop redundant safety on cache lifetime for tmp401 driver. - Add explicit maintainer for LM95234 and TMP401 drivers. * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: MAINTAINERS: Add myself as maintainer for LM95234 and TMP401 drivers hwmon: (tmp401) Drop redundant safety on cache lifetime hwmon: fix error return code in abituguru_probe() hwmon: (iio_hwmon) Fix null pointer dereference hwmon: (nct6775) Do not create non-existing attributes hwmon: (iio_hwmon) Fix missing iio_channel_release_all call if devm_kzalloc fail
Diffstat (limited to 'drivers/hwmon/nct6775.c')
-rw-r--r--drivers/hwmon/nct6775.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index f43f5e571db9..04638aee9039 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
@@ -3705,8 +3705,10 @@ static int nct6775_probe(struct platform_device *pdev)
data->have_temp |= 1 << i;
data->have_temp_fixed |= 1 << i;
data->reg_temp[0][i] = reg_temp_alternate[i];
- data->reg_temp[1][i] = reg_temp_over[i];
- data->reg_temp[2][i] = reg_temp_hyst[i];
+ if (i < num_reg_temp) {
+ data->reg_temp[1][i] = reg_temp_over[i];
+ data->reg_temp[2][i] = reg_temp_hyst[i];
+ }
data->temp_src[i] = i + 1;
continue;
}