aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammad Qasim Abdul Majeed <[email protected]>2024-09-15 23:38:18 +0500
committerRafael J. Wysocki <[email protected]>2024-11-05 21:35:36 +0100
commit04c2d3a9c4787596adc638957d9766c5ebbd3f4f (patch)
tree261bc65fe23ae47797398a958602651a031ff17e
parent9ff236786334d69dd85d8bc5c208fa31d458e1c7 (diff)
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: https://github.com/KSPP/linux/issues/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]>
-rw-r--r--drivers/acpi/power.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index c2c70139c4f1..25174c24d3d7 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -950,8 +950,8 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle)
mutex_init(&resource->resource_lock);
INIT_LIST_HEAD(&resource->list_node);
INIT_LIST_HEAD(&resource->dependents);
- strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
- strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
+ strscpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
+ strscpy(acpi_device_class(device), ACPI_POWER_CLASS);
device->power.state = ACPI_STATE_UNKNOWN;
device->flags.match_driver = true;