Skip to content

Commit efb365b

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/pci_link.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,8 @@ static int acpi_pci_link_add(struct acpi_device *device,
714714
return -ENOMEM;
715715

716716
link->device = device;
717-
strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME);
718-
strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS);
717+
strscpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME);
718+
strscpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS);
719719
device->driver_data = link;
720720

721721
mutex_lock(&acpi_link_lock);

0 commit comments

Comments
 (0)