From: Ander Conselvan de Oliveira Date: Mon, 30 Mar 2015 11:05:43 +0000 (+0300) Subject: drm/atomic: Don't try to free a NULL state X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a0211bb482c346820506c546a6a58b8357999a99;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/atomic: Don't try to free a NULL state Consistently with other free functions, handle the NULL case without oopsing. Cc: dri-devel@lists.freedesktop.org Signed-off-by: Ander Conselvan de Oliveira Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 00ea88151c01..57efdbeff008 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -173,6 +173,9 @@ EXPORT_SYMBOL(drm_atomic_state_clear); */ void drm_atomic_state_free(struct drm_atomic_state *state) { + if (!state) + return; + drm_atomic_state_clear(state); DRM_DEBUG_ATOMIC("Freeing atomic state %p\n", state);