Commit 1ccc3bec authored by Thorsten Blum's avatar Thorsten Blum Committed by Rafael J. Wysocki
Browse files

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: default avatarThorsten Blum <thorsten.blum@linux.dev>
[ rjw: Subject and changelog tweaks ]
Link: https://patch.msgid.link/20260112174901.767434-1-thorsten.blum@linux.dev


Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent c116cab8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)