Skip to content

Commit 95504d5

Browse files
Abdul Rahimrafaeljw
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 59b723c commit 95504d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/acpi/thermal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,9 @@ static int acpi_thermal_add(struct acpi_device *device)
796796
return -ENOMEM;
797797

798798
tz->device = device;
799-
strcpy(tz->name, device->pnp.bus_id);
800-
strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME);
801-
strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS);
799+
strscpy(tz->name, device->pnp.bus_id);
800+
strscpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME);
801+
strscpy(acpi_device_class(device), ACPI_THERMAL_CLASS);
802802
device->driver_data = tz;
803803

804804
acpi_thermal_aml_dependency_fix(tz);

0 commit comments

Comments
 (0)