From 0151814c4c60c8e789f4f764037a19bce0a5632a Mon Sep 17 00:00:00 2001 From: Muhammad Qasim Abdul Majeed Date: Sun, 15 Sep 2024 23:38:13 +0500 Subject: [PATCH] ACPI: APD: Use strscpy() instead of strcpy() Replace strcpy() with strscpy() in the ACPI APD driver. strcpy() has been deprecated because it is generally unsafe, so it is better to eliminate it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed Link: https://patch.msgid.link/20240915183822.34588-1-qasim.majeed20@gmail.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_apd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index 800f97868448..49539f7528c6 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -86,7 +86,7 @@ static int fch_misc_setup(struct apd_private_data *pdata) if (!clk_data->name) return -ENOMEM; - strcpy(clk_data->name, obj->string.pointer); + strscpy(clk_data->name, obj->string.pointer, obj->string.length); } else { /* Set default name to mclk if entry missing in firmware */ clk_data->name = "mclk";