diff options
| author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2025-04-07 20:08:38 +0300 |
|---|---|---|
| committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2025-04-11 14:04:13 +0300 |
| commit | 8625c4c06a79ddddcc53ead898bf721cee618e4e (patch) | |
| tree | e3156b5262fff9cde0c36631c118cd9cd38e60d2 /drivers/platform/x86/thinkpad_acpi.c | |
| parent | 361813db5d9ba33434754c0de1207a2b91264ab1 (diff) | |
platform/x86: Use strscpy()/scnprintf() with acpi_device_name/class()
Replace strcpy() and sprintf() for acpi_device_name/class() targets
with safer variant. In one case, scnprintf() is necessary but the
rest can use strscpy().
Link: https://lore.kernel.org/r/20250407170839.2153-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/thinkpad_acpi.c')
| -rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 5790095c175e..9bb191a32e80 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -836,9 +836,9 @@ static int __init setup_acpi_notify(struct ibm_struct *ibm) } ibm->acpi->device->driver_data = ibm; - sprintf(acpi_device_class(ibm->acpi->device), "%s/%s", - TPACPI_ACPI_EVENT_PREFIX, - ibm->name); + scnprintf(acpi_device_class(ibm->acpi->device), + sizeof(acpi_device_class(ibm->acpi->device)), + "%s/%s", TPACPI_ACPI_EVENT_PREFIX, ibm->name); status = acpi_install_notify_handler(*ibm->acpi->handle, ibm->acpi->type, dispatch_acpi_notify, ibm); |