mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:46:16 +00:00
ACPI: thermal: Use strscpy() instead of strcpy()
strcpy() is generally considered unsafe and use of strscpy() is recommended [1]. Also using strscpy() instead of strcpy() makes the following checkpatch warning go away: WARNING: Prefer strscpy over strcpy Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1] Signed-off-by: Abdul Rahim <abdul.rahim@myyahoo.com> Link: https://patch.msgid.link/20240913211156.103864-1-abdul.rahim@myyahoo.com [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
59b723cd2a
commit
95504d54a2
@ -796,9 +796,9 @@ static int acpi_thermal_add(struct acpi_device *device)
|
||||
return -ENOMEM;
|
||||
|
||||
tz->device = device;
|
||||
strcpy(tz->name, device->pnp.bus_id);
|
||||
strcpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME);
|
||||
strcpy(acpi_device_class(device), ACPI_THERMAL_CLASS);
|
||||
strscpy(tz->name, device->pnp.bus_id);
|
||||
strscpy(acpi_device_name(device), ACPI_THERMAL_DEVICE_NAME);
|
||||
strscpy(acpi_device_class(device), ACPI_THERMAL_CLASS);
|
||||
device->driver_data = tz;
|
||||
|
||||
acpi_thermal_aml_dependency_fix(tz);
|
||||
|
Loading…
Reference in New Issue
Block a user