aboutsummaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorEduardo Valentin <eduardo.valentin@ti.com>2013-04-17 17:12:17 +0000
committerZhang Rui <rui.zhang@intel.com>2013-04-25 00:34:43 +0800
commit99871a714b0a9429e960629fbc2c6c20c57ea484 (patch)
tree2d30c5e08ce08c7b483f2ad1630d6ec574e57731 /drivers/thermal
parent135266b4ea4567419c475354437b7aaa96023d9e (diff)
thermal: cpu_cooling: use snprintf instead of sprintf
Limit the amount of bytes written to dev_name by secure writing with snprintf. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/cpu_cooling.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index b4161cfce4a..a04269de157 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -458,7 +458,8 @@ struct thermal_cooling_device *cpufreq_cooling_register(
return ERR_PTR(-EINVAL);
}
- sprintf(dev_name, "thermal-cpufreq-%d", cpufreq_dev->id);
+ snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",
+ cpufreq_dev->id);
cool_dev = thermal_cooling_device_register(dev_name, cpufreq_dev,
&cpufreq_cooling_ops);