Skip to content

Commit 9ff2367

Browse files
qa-majeedrafaeljw
authored andcommitted
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: KSPP#88 Signed-off-by: Muhammad Qasim Abdul Majeed <qasim.majeed20@gmail.com> Link: https://patch.msgid.link/20240915183822.34588-5-qasim.majeed20@gmail.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent efb365b commit 9ff2367

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/pci_root.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,8 @@ static int acpi_pci_root_add(struct acpi_device *device,
689689

690690
root->device = device;
691691
root->segment = segment & 0xFFFF;
692-
strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME);
693-
strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS);
692+
strscpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME);
693+
strscpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS);
694694
device->driver_data = root;
695695

696696
if (hotadd && dmar_device_add(handle)) {

0 commit comments

Comments
 (0)