Skip to content

Commit 04c2d3a

Browse files
qa-majeedrafaeljw
authored andcommitted
ACPI: power: Use strscpy() instead of strcpy()
Replace strcpy() with strscpy() in the ACPI power resource 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-6-qasim.majeed20@gmail.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 9ff2367 commit 04c2d3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/power.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,8 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle)
950950
mutex_init(&resource->resource_lock);
951951
INIT_LIST_HEAD(&resource->list_node);
952952
INIT_LIST_HEAD(&resource->dependents);
953-
strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
954-
strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
953+
strscpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
954+
strscpy(acpi_device_class(device), ACPI_POWER_CLASS);
955955
device->power.state = ACPI_STATE_UNKNOWN;
956956
device->flags.match_driver = true;
957957

0 commit comments

Comments
 (0)