Commit 9ff23678 authored by Muhammad Qasim Abdul Majeed's avatar Muhammad Qasim Abdul Majeed Committed by Rafael J. Wysocki
Browse files

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: default avatarMuhammad 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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent efb365b7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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)) {