From: Thorsten Blum Date: Fri, 17 Oct 2025 15:33:54 +0000 (+0200) Subject: cpufreq: Replace deprecated strcpy() in cpufreq_unregister_governor() X-Git-Tag: v6.19-rc1~203^2~3^2~5^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ace04717749d20e34dac9f78c5ac772168232b67;p=thirdparty%2Fkernel%2Flinux.git cpufreq: Replace deprecated strcpy() in cpufreq_unregister_governor() strcpy() is deprecated; assign the NUL terminator directly instead. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Thorsten Blum [ rjw: Subject tweaks ] Link: https://patch.msgid.link/20251017153354.82009-2-thorsten.blum@linux.dev Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 4a27f6cb07d38..4472bb1ec83c7 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2553,7 +2553,7 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor) for_each_inactive_policy(policy) { if (!strcmp(policy->last_governor, governor->name)) { policy->governor = NULL; - strcpy(policy->last_governor, "\0"); + policy->last_governor[0] = '\0'; } } read_unlock_irqrestore(&cpufreq_driver_lock, flags);