diff options
author | Muhammad Qasim Abdul Majeed <qasim.majeed20@gmail.com> | 2024-09-15 23:38:15 +0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-11-05 21:35:35 +0100 |
commit | e7eb88e3835f7aebd8462179bb71b92fba73efd1 (patch) | |
tree | 91ca6e1105be2fa1404ef7c111a1f3c84c6ebe4f /drivers/acpi | |
parent | f098bb555fdd9e6eede8664e308d4b211946853d (diff) |
ACPI: event: Use strscpy() instead of strcpy()
Replace strcpy() with strscpy() in the ACPI event 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-3-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/event.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index d199a19bb292..96a9aaaaf9f7 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c @@ -28,8 +28,8 @@ int acpi_notifier_call_chain(struct acpi_device *dev, u32 type, u32 data) { struct acpi_bus_event event; - strcpy(event.device_class, dev->pnp.device_class); - strcpy(event.bus_id, dev->pnp.bus_id); + strscpy(event.device_class, dev->pnp.device_class); + strscpy(event.bus_id, dev->pnp.bus_id); event.type = type; event.data = data; return (blocking_notifier_call_chain(&acpi_chain_head, 0, (void *)&event) |