drm: atmel-hlcdc: fix a NULL check
If kmalloc() returned NULL we would end up dereferencing "state" a couple lines later. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
This commit is contained in:
parent
c2e4c99444
commit
58a2ab3af7
@ -414,7 +414,8 @@ atmel_hlcdc_crtc_duplicate_state(struct drm_crtc *crtc)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
state = kmalloc(sizeof(*state), GFP_KERNEL);
|
state = kmalloc(sizeof(*state), GFP_KERNEL);
|
||||||
if (state)
|
if (!state)
|
||||||
|
return NULL;
|
||||||
__drm_atomic_helper_crtc_duplicate_state(crtc, &state->base);
|
__drm_atomic_helper_crtc_duplicate_state(crtc, &state->base);
|
||||||
|
|
||||||
cur = drm_crtc_state_to_atmel_hlcdc_crtc_state(crtc->state);
|
cur = drm_crtc_state_to_atmel_hlcdc_crtc_state(crtc->state);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user