public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/atomic: Don't try to free a NULL state
@ 2015-03-30 11:05 Ander Conselvan de Oliveira
  2015-03-30 11:35 ` David Weinehall
  2015-03-30 14:33 ` shuang.he
  0 siblings, 2 replies; 4+ messages in thread
From: Ander Conselvan de Oliveira @ 2015-03-30 11:05 UTC (permalink / raw)
  To: dri-devel; +Cc: Ander Conselvan de Oliveira, intel-gfx

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>
---
 drivers/gpu/drm/drm_atomic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 23034e8..88b2790 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -179,6 +179,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);
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-30 14:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-30 11:05 [PATCH] drm/atomic: Don't try to free a NULL state Ander Conselvan de Oliveira
2015-03-30 11:35 ` David Weinehall
2015-03-30 14:52   ` Daniel Vetter
2015-03-30 14:33 ` shuang.he

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox