mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
drm/omap: Potential NULL deref in omap_crtc_duplicate_state()
If the kmalloc() fails then we dereference "state" when we set
"state->zpos".
Fixes: 3dfeb631a1
("drm/omap: Rework the rotation-on-crtc hack")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
parent
4161f200ff
commit
2419672f4c
1 changed files with 4 additions and 2 deletions
|
@ -589,8 +589,10 @@ omap_crtc_duplicate_state(struct drm_crtc *crtc)
|
|||
current_state = to_omap_crtc_state(crtc->state);
|
||||
|
||||
state = kmalloc(sizeof(*state), GFP_KERNEL);
|
||||
if (state)
|
||||
__drm_atomic_helper_crtc_duplicate_state(crtc, &state->base);
|
||||
if (!state)
|
||||
return NULL;
|
||||
|
||||
__drm_atomic_helper_crtc_duplicate_state(crtc, &state->base);
|
||||
|
||||
state->zpos = current_state->zpos;
|
||||
state->rotation = current_state->rotation;
|
||||
|
|
Loading…
Reference in a new issue