Skip to content

Commit f098bb5

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/ec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,8 +1677,8 @@ static int acpi_ec_add(struct acpi_device *device)
16771677
struct acpi_ec *ec;
16781678
int ret;
16791679

1680-
strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
1681-
strcpy(acpi_device_class(device), ACPI_EC_CLASS);
1680+
strscpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
1681+
strscpy(acpi_device_class(device), ACPI_EC_CLASS);
16821682

16831683
if (boot_ec && (boot_ec->handle == device->handle ||
16841684
!strcmp(acpi_device_hid(device), ACPI_ECDT_HID))) {

0 commit comments

Comments
 (0)