Commit cfc38d43 authored by Muhammad Qasim Abdul Majeed's avatar Muhammad Qasim Abdul Majeed Committed by Rafael J. Wysocki
Browse files

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: default avatarMuhammad 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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 22a40d14
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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);