Commit 6d10dc61 authored by Dan Carpenter's avatar Dan Carpenter Committed by Liviu Dudau

drm/komeda: Potential error pointer dereference

We need to check whether drm_atomic_get_crtc_state() returns an error
pointer before dereferencing "crtc_st".

Fixes: 9e560309 ("drm/komeda: Add komeda_plane/plane_helper_funcs")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatar"james qian wang (Arm Technology China)" <james.qian.wang@arm.com>
Signed-off-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
parent 7cb8bec2
...@@ -63,7 +63,7 @@ komeda_plane_atomic_check(struct drm_plane *plane, ...@@ -63,7 +63,7 @@ komeda_plane_atomic_check(struct drm_plane *plane,
return 0; return 0;
crtc_st = drm_atomic_get_crtc_state(state->state, state->crtc); crtc_st = drm_atomic_get_crtc_state(state->state, state->crtc);
if (!crtc_st->enable) { if (IS_ERR(crtc_st) || !crtc_st->enable) {
DRM_DEBUG_ATOMIC("Cannot update plane on a disabled CRTC.\n"); DRM_DEBUG_ATOMIC("Cannot update plane on a disabled CRTC.\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment