提交 6d10dc61 编写于 作者: D Dan Carpenter 提交者: 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: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: N"james qian wang (Arm Technology China)" <james.qian.wang@arm.com>
Signed-off-by: NLiviu Dudau <liviu.dudau@arm.com>
上级 7cb8bec2
......@@ -63,7 +63,7 @@ komeda_plane_atomic_check(struct drm_plane *plane,
return 0;
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");
return -EINVAL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册