Skip to content

Commit c4ff125

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/sbs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,8 @@ static int acpi_sbs_add(struct acpi_device *device)
644644

645645
sbs->hc = acpi_driver_data(acpi_dev_parent(device));
646646
sbs->device = device;
647-
strcpy(acpi_device_name(device), ACPI_SBS_DEVICE_NAME);
648-
strcpy(acpi_device_class(device), ACPI_SBS_CLASS);
647+
strscpy(acpi_device_name(device), ACPI_SBS_DEVICE_NAME);
648+
strscpy(acpi_device_class(device), ACPI_SBS_CLASS);
649649
device->driver_data = sbs;
650650

651651
result = acpi_charger_add(sbs);

0 commit comments

Comments
 (0)