Skip to content

Commit cfc38d4

Browse files
qa-majeedrafaeljw
authored andcommitted
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: KSPP#88 Signed-off-by: Muhammad Qasim Abdul Majeed <[email protected]> Link: https://patch.msgid.link/[email protected] [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 22a40d1 commit cfc38d4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/acpi/acpi_video.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,8 @@ static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg)
11281128
return -ENOMEM;
11291129
}
11301130

1131-
strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);
1132-
strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
1131+
strscpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);
1132+
strscpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
11331133

11341134
data->device_id = device_id;
11351135
data->video = video;
@@ -2010,8 +2010,8 @@ static int acpi_video_bus_add(struct acpi_device *device)
20102010
}
20112011

20122012
video->device = device;
2013-
strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
2014-
strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
2013+
strscpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
2014+
strscpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
20152015
device->driver_data = video;
20162016

20172017
acpi_video_bus_find_cap(video);

0 commit comments

Comments
 (0)