Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99871a71 authored by Eduardo Valentin's avatar Eduardo Valentin Committed by Zhang Rui
Browse files

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: default avatarEduardo Valentin <eduardo.valentin@ti.com>
Acked-by: default avatarAmit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 135266b4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);