summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorMuhammad Qasim Abdul Majeed <qasim.majeed20@gmail.com>2024-09-15 23:38:14 +0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-11-05 21:35:35 +0100
commitf098bb555fdd9e6eede8664e308d4b211946853d (patch)
treecf192c73f43dbe721d0543deda1a7076c637c3d0 /drivers/acpi
parent0151814c4c60c8e789f4f764037a19bce0a5632a (diff)
downloadlinux-stable-f098bb555fdd9e6eede8664e308d4b211946853d.tar.gz
linux-stable-f098bb555fdd9e6eede8664e308d4b211946853d.tar.bz2
linux-stable-f098bb555fdd9e6eede8664e308d4b211946853d.zip
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: https://github.com/KSPP/linux/issues/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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/ec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 25399f6dde7e..8db09d81918f 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -1677,8 +1677,8 @@ static int acpi_ec_add(struct acpi_device *device)
struct acpi_ec *ec;
int ret;
- strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
- strcpy(acpi_device_class(device), ACPI_EC_CLASS);
+ strscpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
+ strscpy(acpi_device_class(device), ACPI_EC_CLASS);
if (boot_ec && (boot_ec->handle == device->handle ||
!strcmp(acpi_device_hid(device), ACPI_ECDT_HID))) {