From: Muhammad Qasim Abdul Majeed Date: Sun, 15 Sep 2024 18:38:17 +0000 (+0500) Subject: ACPI: pci_root: Use strscpy() instead of strcpy() X-Git-Tag: v6.13-rc1~192^2^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ff236786334d69dd85d8bc5c208fa31d458e1c7;p=thirdparty%2Flinux.git ACPI: pci_root: Use strscpy() instead of strcpy() Replace strcpy() with strscpy() in the ACPI pci_root 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 Link: https://patch.msgid.link/20240915183822.34588-5-qasim.majeed20@gmail.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index d0bfb37068019..d0b6a024daaec 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -689,8 +689,8 @@ static int acpi_pci_root_add(struct acpi_device *device, root->device = device; root->segment = segment & 0xFFFF; - strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); + strscpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); device->driver_data = root; if (hotadd && dmar_device_add(handle)) {