Skip to content

Commit 0151814

Browse files
qa-majeedrafaeljw
authored andcommitted
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: KSPP#88 Signed-off-by: Muhammad Qasim Abdul Majeed <qasim.majeed20@gmail.com> Link: https://patch.msgid.link/20240915183822.34588-1-qasim.majeed20@gmail.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 95504d5 commit 0151814

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/acpi/acpi_apd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static int fch_misc_setup(struct apd_private_data *pdata)
8686
if (!clk_data->name)
8787
return -ENOMEM;
8888

89-
strcpy(clk_data->name, obj->string.pointer);
89+
strscpy(clk_data->name, obj->string.pointer, obj->string.length);
9090
} else {
9191
/* Set default name to mclk if entry missing in firmware */
9292
clk_data->name = "mclk";

0 commit comments

Comments
 (0)