Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <thorsten.blum@linux.dev>
[ rjw: Subject tweaks ]
Link: https://patch.msgid.link/20251017153354.82009-2-thorsten.blum@linux.dev
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Thorsten Blum and committed by
Rafael J. Wysocki
ace04717 5313ec4a

+1 -1
+1 -1
drivers/cpufreq/cpufreq.c
··· 2553 2553 for_each_inactive_policy(policy) { 2554 2554 if (!strcmp(policy->last_governor, governor->name)) { 2555 2555 policy->governor = NULL; 2556 - strcpy(policy->last_governor, "\0"); 2556 + policy->last_governor[0] = '\0'; 2557 2557 } 2558 2558 } 2559 2559 read_unlock_irqrestore(&cpufreq_driver_lock, flags);