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 <[email protected]> Link: https://patch.msgid.link/[email protected] [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 95504d5 commit 0151814

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)