summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vkms
diff options
context:
space:
mode:
authorLouis Chauvet <louis.chauvet@bootlin.com>2024-09-06 18:15:03 +0200
committerMaíra Canal <mcanal@igalia.com>2024-09-24 20:44:59 -0300
commit2f7bd9d66e638e1ce4a20fea83c9d44c25c3dae8 (patch)
tree666693a1376917110e3dac63648a1cd49a407542 /drivers/gpu/drm/vkms
parent2b75feb312894f87d0539d46eeb364f447df723f (diff)
drm/vkms: Add missing check for CRTC initialization
CRTC initialization call drm_mode_crtc_set_gamma_size without the proper checks, introduce this check to avoid issues. Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Reviewed-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Maíra Canal <mcanal@igalia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240906-vkms-add-missing-check-v1-1-1afb3bf3d0a6@bootlin.com
Diffstat (limited to 'drivers/gpu/drm/vkms')
-rw-r--r--drivers/gpu/drm/vkms/vkms_crtc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
index 2ad164b518fb..a40295c18b48 100644
--- a/drivers/gpu/drm/vkms/vkms_crtc.c
+++ b/drivers/gpu/drm/vkms/vkms_crtc.c
@@ -289,7 +289,12 @@ int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
drm_crtc_helper_add(crtc, &vkms_crtc_helper_funcs);
- drm_mode_crtc_set_gamma_size(crtc, VKMS_LUT_SIZE);
+ ret = drm_mode_crtc_set_gamma_size(crtc, VKMS_LUT_SIZE);
+ if (ret) {
+ DRM_ERROR("Failed to set gamma size\n");
+ return ret;
+ }
+
drm_crtc_enable_color_mgmt(crtc, 0, false, VKMS_LUT_SIZE);
spin_lock_init(&vkms_out->lock);