From: Abdul Rahim Date: Fri, 13 Sep 2024 21:11:35 +0000 (+0530) Subject: ACPI: thermal: Use strscpy() instead of strcpy() X-Git-Tag: v6.13-rc1~192^2^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=95504d54a2751ad3e995c7bbafc2116affb28ab9;p=thirdparty%2Flinux.git ACPI: thermal: Use strscpy() instead of strcpy() strcpy() is generally considered unsafe and use of strscpy() is recommended [1]. Also using strscpy() instead of strcpy() makes the following checkpatch warning go away: WARNING: Prefer strscpy over strcpy Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1] Signed-off-by: Abdul Rahim Link: https://patch.msgid.link/20240913211156.103864-1-abdul.rahim@myyahoo.com [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 78db38c7076e4..6671537cb4b7d 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -796,9 +796,9 @@ static int acpi_thermal_add(struct acpi_device *device) return -ENOMEM; tz->device = device; - strcpy(tz->name, device->pnp.bus_id); - strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS); + strscpy(tz->name, device->pnp.bus_id); + strscpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_THERMAL_CLASS); device->driver_data = tz; acpi_thermal_aml_dependency_fix(tz);