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 <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>
This commit is contained in:
Muhammad Qasim Abdul Majeed 2024-09-15 23:38:13 +05:00 committed by Rafael J. Wysocki
parent 95504d54a2
commit 0151814c4c

View File

@ -86,7 +86,7 @@ static int fch_misc_setup(struct apd_private_data *pdata)
if (!clk_data->name) if (!clk_data->name)
return -ENOMEM; return -ENOMEM;
strcpy(clk_data->name, obj->string.pointer); strscpy(clk_data->name, obj->string.pointer, obj->string.length);
} else { } else {
/* Set default name to mclk if entry missing in firmware */ /* Set default name to mclk if entry missing in firmware */
clk_data->name = "mclk"; clk_data->name = "mclk";