ACPI: video: Use strscpy() instead of strcpy()
Replace strcpy() with strscpy() in the ACPI backlight code. strcpy() has been deprecated because it is generally unsafe, so help to eliminate if 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/20240703084124.11530-1-qasim.majeed20@gmail.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
22a40d14b5
commit
cfc38d432d
@ -1128,8 +1128,8 @@ static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);
|
||||
strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
|
||||
strscpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);
|
||||
strscpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
|
||||
|
||||
data->device_id = device_id;
|
||||
data->video = video;
|
||||
@ -2010,8 +2010,8 @@ static int acpi_video_bus_add(struct acpi_device *device)
|
||||
}
|
||||
|
||||
video->device = device;
|
||||
strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
|
||||
strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
|
||||
strscpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
|
||||
strscpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
|
||||
device->driver_data = video;
|
||||
|
||||
acpi_video_bus_find_cap(video);
|
||||
|
Loading…
Reference in New Issue
Block a user