diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-05-03 15:25:25 +0300 |
---|---|---|
committer | Liviu Dudau <Liviu.Dudau@arm.com> | 2019-06-06 09:00:29 +0100 |
commit | 6d10dc617b4128c06fc2a88b47fda0a183ffe36c (patch) | |
tree | f3fe548af5dbc7df332b2bbc36034cef6ca3743e /drivers/gpu/drm/arm | |
parent | 7cb8bec205258601af2810f4f1998a207340e73c (diff) | |
download | linux-6d10dc617b4128c06fc2a88b47fda0a183ffe36c.tar.bz2 |
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: 9e5603094176 ("drm/komeda: Add komeda_plane/plane_helper_funcs")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: "james qian wang (Arm Technology China)" <james.qian.wang@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Diffstat (limited to 'drivers/gpu/drm/arm')
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c index 0753892b98d2..c97062bdd69b 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c @@ -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; } |