summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Forbes <ian.forbes@broadcom.com>2024-08-09 20:37:56 +0200
committerZack Rusin <zack.rusin@broadcom.com>2024-10-10 20:27:51 +0200
commit4809a017a2bc42ff239d53ade4b2e70f2fe81348 (patch)
tree6bfc156a9e03cf2fd45d4f83afd46fda3f0fd4d7
parentdrm/vmwgfx: Limit display layout ioctl array size to VMWGFX_NUM_DISPLAY_UNITS (diff)
downloadlinux-4809a017a2bc42ff239d53ade4b2e70f2fe81348.tar.xz
linux-4809a017a2bc42ff239d53ade4b2e70f2fe81348.zip
drm/vmwgfx: Handle possible ENOMEM in vmw_stdu_connector_atomic_check
Handle unlikely ENOMEN condition and other errors in vmw_stdu_connector_atomic_check. Signed-off-by: Ian Forbes <ian.forbes@broadcom.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Fixes: 75c3e8a26a35 ("drm/vmwgfx: Trigger a modeset when the screen moves") Reviewed-by: Zack Rusin <zack.rusin@broadcom.com> Reviewed-by: Martin Krastev <martin.krastev@broadcom.com> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240809183756.27283-1-ian.forbes@broadcom.com
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
index fab155a68054..82d18b88f4a7 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
@@ -886,6 +886,10 @@ static int vmw_stdu_connector_atomic_check(struct drm_connector *conn,
struct drm_crtc_state *new_crtc_state;
conn_state = drm_atomic_get_connector_state(state, conn);
+
+ if (IS_ERR(conn_state))
+ return PTR_ERR(conn_state);
+
du = vmw_connector_to_stdu(conn);
if (!conn_state->crtc)