summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_modes.c
diff options
context:
space:
mode:
authorMaxime Ripard <mripard@kernel.org>2024-01-29 14:20:23 +0100
committerMaxime Ripard <mripard@kernel.org>2024-01-29 14:20:23 +0100
commit4db102dcb0396a4ccf89b1eac0f4eb3fd167a080 (patch)
treeea47469abffb236c5ba305c8a406e1f8209c6f34 /drivers/gpu/drm/drm_modes.c
parentaeb262c353354eab81ab0d3242afa70984b7dc34 (diff)
parent6613476e225e090cc9aad49be7fa504e290dd33d (diff)
Merge drm/drm-next into drm-misc-next
Kickstart 6.9 development cycle. Signed-off-by: Maxime Ripard <mripard@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
-rw-r--r--drivers/gpu/drm/drm_modes.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 45238ec5df1b..c4f88c3a93b7 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -2617,8 +2617,7 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
break;
}
- strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
- out->name[DRM_DISPLAY_MODE_LEN-1] = 0;
+ strscpy_pad(out->name, in->name, sizeof(out->name));
}
/**
@@ -2659,8 +2658,7 @@ int drm_mode_convert_umode(struct drm_device *dev,
* useful for the kernel->userspace direction anyway.
*/
out->type = in->type & DRM_MODE_TYPE_ALL;
- strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
- out->name[DRM_DISPLAY_MODE_LEN-1] = 0;
+ strscpy_pad(out->name, in->name, sizeof(out->name));
/* Clearing picture aspect ratio bits from out flags,
* as the aspect-ratio information is not stored in