From 1ccc3bec14b85fd67f30272bc6d14b2aada25203 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Mon, 12 Jan 2026 18:49:00 +0100 Subject: [PATCH] thermal: sysfs: Replace snprintf() with strscpy() in policy_store() There is no need to use snprintf() with a format specifier to copy 'buf' to 'name'; use strscpy() directly instead. Signed-off-by: Thorsten Blum [ rjw: Subject and changelog tweaks ] Link: https://patch.msgid.link/20260112174901.767434-1-thorsten.blum@linux.dev Signed-off-by: Rafael J. Wysocki --- drivers/thermal/thermal_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index 26b8b340fbe65..2538c2dcf6a9e 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -199,7 +199,7 @@ policy_store(struct device *dev, struct device_attribute *attr, char name[THERMAL_NAME_LENGTH]; int ret; - snprintf(name, sizeof(name), "%s", buf); + strscpy(name, buf); ret = thermal_zone_device_set_policy(tz, name); if (!ret) -- 2.47.3