Skip to content

Commit e7eb88e

Browse files
qa-majeedrafaeljw
authored andcommitted
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: KSPP#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>
1 parent f098bb5 commit e7eb88e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/event.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ int acpi_notifier_call_chain(struct acpi_device *dev, u32 type, u32 data)
2828
{
2929
struct acpi_bus_event event;
3030

31-
strcpy(event.device_class, dev->pnp.device_class);
32-
strcpy(event.bus_id, dev->pnp.bus_id);
31+
strscpy(event.device_class, dev->pnp.device_class);
32+
strscpy(event.bus_id, dev->pnp.bus_id);
3333
event.type = type;
3434
event.data = data;
3535
return (blocking_notifier_call_chain(&acpi_chain_head, 0, (void *)&event)

0 commit comments

Comments
 (0)