drm/atomic: Don't try to free a NULL state
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Mon, 30 Mar 2015 11:05:43 +0000 (14:05 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 30 Mar 2015 14:52:09 +0000 (16:52 +0200)
Consistently with other free functions, handle the NULL case without
oopsing.

Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_atomic.c

index 00ea881..57efdbe 100644 (file)
@@ -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);