diff options
-rw-r--r-- | drivers/thermal/thermal_sys.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 5be8728c88a3..36e6f4d4ec3b 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c | |||
@@ -598,7 +598,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) | |||
598 | temp->tz = tz; | 598 | temp->tz = tz; |
599 | hwmon->count++; | 599 | hwmon->count++; |
600 | 600 | ||
601 | snprintf(temp->temp_input.name, THERMAL_NAME_LENGTH, | 601 | snprintf(temp->temp_input.name, sizeof(temp->temp_input.name), |
602 | "temp%d_input", hwmon->count); | 602 | "temp%d_input", hwmon->count); |
603 | temp->temp_input.attr.attr.name = temp->temp_input.name; | 603 | temp->temp_input.attr.attr.name = temp->temp_input.name; |
604 | temp->temp_input.attr.attr.mode = 0444; | 604 | temp->temp_input.attr.attr.mode = 0444; |
@@ -611,7 +611,8 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) | |||
611 | if (tz->ops->get_crit_temp) { | 611 | if (tz->ops->get_crit_temp) { |
612 | unsigned long temperature; | 612 | unsigned long temperature; |
613 | if (!tz->ops->get_crit_temp(tz, &temperature)) { | 613 | if (!tz->ops->get_crit_temp(tz, &temperature)) { |
614 | snprintf(temp->temp_crit.name, THERMAL_NAME_LENGTH, | 614 | snprintf(temp->temp_crit.name, |
615 | sizeof(temp->temp_crit.name), | ||
615 | "temp%d_crit", hwmon->count); | 616 | "temp%d_crit", hwmon->count); |
616 | temp->temp_crit.attr.attr.name = temp->temp_crit.name; | 617 | temp->temp_crit.attr.attr.name = temp->temp_crit.name; |
617 | temp->temp_crit.attr.attr.mode = 0444; | 618 | temp->temp_crit.attr.attr.mode = 0444; |