[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240915183822.34588-1-qasim.majeed20@gmail.com>
Date: Sun, 15 Sep 2024 23:38:13 +0500
From: Muhammad Qasim Abdul Majeed <qasim.majeed20@...il.com>
To: rafael@...nel.org,
lenb@...nel.org,
linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Muhammad Qasim Abdul Majeed <qasim.majeed20@...il.com>
Subject: [PATCH 01/10] 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.
Eliminating it from the kernel source.
Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Muhammad Qasim Abdul Majeed <qasim.majeed20@...il.com>
---
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 80f945cbec8a..403e9de396ae 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";
--
2.43.0
Powered by blists - more mailing lists