]> Gentwo Git Trees - linux/.git/commitdiff
thermal: hwmon: replace deprecated strcpy() with strscpy()
authorOsama Abdelkader <osama.abdelkader@gmail.com>
Wed, 3 Sep 2025 19:20:59 +0000 (21:20 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 5 Sep 2025 18:51:28 +0000 (20:51 +0200)
Since strcpy() is deprecated and the last user of it in the thermal
subsystem is thermal_hwmon_lookup_by_type(), replace strcpy() in that
function with strscpy().

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20250903192059.11353-1-osama.abdelkader@gmail.com
[ rjw: Changelog rewrite ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/thermal_hwmon.c

index 0ecccd4d8556c4960748ba9292d49e0380b7df0d..64cc3ab949fed4de35a1cbe310d373263a60725a 100644 (file)
@@ -96,7 +96,7 @@ thermal_hwmon_lookup_by_type(const struct thermal_zone_device *tz)
 
        mutex_lock(&thermal_hwmon_list_lock);
        list_for_each_entry(hwmon, &thermal_hwmon_list, node) {
-               strcpy(type, tz->type);
+               strscpy(type, tz->type);
                strreplace(type, '-', '_');
                if (!strcmp(hwmon->type, type)) {
                        mutex_unlock(&thermal_hwmon_list_lock);