From: Szymon Wilczek <[email protected]>
Date: 20 Dec 2025
Subject: [PATCH] hwmon: (acpi_power_meter) Replace deprecated strcpy() with strscpy()
Merged: 31 Jan 2026, by Guenter Roeck
signed, reported, fixes
- Signed-off-by Szymon Wilczek author
- Reviewed-by lihuisong reviewed it
- Signed-off-by Guenter Roeck maintainer · merged it
diff
@@ -900,8 +900,8 @@ static int acpi_power_meter_add(struct acpi_device *device) resource->sensors_valid = 0; resource->acpi_dev = device; mutex_init(&resource->lock);- strcpy(acpi_device_name(device), ACPI_POWER_METER_DEVICE_NAME);- strcpy(acpi_device_class(device), ACPI_POWER_METER_CLASS);+ strscpy(acpi_device_name(device), ACPI_POWER_METER_DEVICE_NAME);+ strscpy(acpi_device_class(device), ACPI_POWER_METER_CLASS); device->driver_data = resource; #if IS_REACHABLE(CONFIG_ACPI_IPMI) discussion · on the list
v1 · 5 messages
Yacov Simhony reviewer 14 Apr 2025
[PATCH] hwmon: acpi_power_meter: replace deprecated strcpy() with strscpy()
Guenter Roeck maintainer 14 Apr 2025
ACPI_POWER_METER_DEVICE_NAME and ACPI_POWER_METER_CLASS are constant strings.
There is no danger of buffer overflows. There is no safety improvement.
We should concentrate on fixing real problems, not imaginary ones.
Guenter
Szymon Wilczek author 20 Dec 2025
[PATCH] hwmon: (acpi_power_meter) Replace deprecated strcpy() with strscpy()
lihuisong (C) reviewer 23 Dec 2025
LGTM,
Reviewed-by: [email protected]
Guenter Roeck maintainer 12 Jan 2026
Applied.
Thanks,
Guenter