From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> mainline inclusion from mainline-v7.1-rc1 commit 36cb728754ea4583f145ecacb6e4fb9a6d8e62d6 category: bugfix bugzilla: https://atomgit.com/openeuler/kernel/issues/9134 CVE: NA Reference: https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commi... ---------------------------------------------------------------------- strlcpy() and strlcat() are confusing APIs and the former one already gone from the kernel. In preparation to kill strlcat() replace it with the better alternative. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20260317080218.1814693-1-andriy.shevchenko@linux.in... Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Huisong Li <lihuisong@huawei.com> Signed-off-by: Hongye Lin <linhongye@h-partners.com> --- drivers/acpi/processor_idle.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index ef75bf5bea82..b9b3c280a04e 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1025,9 +1025,7 @@ static bool combine_lpi_states(struct acpi_lpi_state *local, result->arch_flags = parent->arch_flags; result->index = parent->index; - strscpy(result->desc, local->desc, ACPI_CX_DESC_LEN); - strlcat(result->desc, "+", ACPI_CX_DESC_LEN); - strlcat(result->desc, parent->desc, ACPI_CX_DESC_LEN); + scnprintf(result->desc, ACPI_CX_DESC_LEN, "%s+%s", local->desc, parent->desc); return true; } -- 2.33.0