Skip to contentSkip to conversation

drm/atomic: Don't try to free a NULL state

PATCH In review Ander Conselvan de Oliveira 4 participants 4 messages Mar 30, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/atomic: Don't try to free a NULL state

Consistently with other free functions, handle the NULL case without oopsing.

---
 drivers/gpu/drm/drm_atomic.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_atomic.c +3 -0
index 23034e8..88b2790 100644
@@ -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);
Signature · 6 lines
2.1.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 14 lines · Ander Conselvan de Oliveira

Consistently with other free functions, handle the NULL case without oopsing.

---
 drivers/gpu/drm/drm_atomic.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_atomic.c +0 -0
index 23034e8..88b2790 100644

drivers/gpu/drm/drm_atomic.c EXPORT_SYMBOL(drm_atomic_state_clear); · line 187

Quoted 9 lines
drivers/gpu/drm/drm_atomic.c +3 -0
@@ -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);

It'd probably make sense to fix all code that uses drm_atomic_state_free() at the same time.

Regards, David Weinehall
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
Quoted 23 lines · David Weinehall
Quoted 22 lines · Ander Conselvan de Oliveira

Consistently with other free functions, handle the NULL case without oopsing.

---
 drivers/gpu/drm/drm_atomic.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_atomic.c +3 -0
index 23034e8..88b2790 100644
@@ -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);
 
Quoted 4 lines

drivers/gpu/drm/drm_atomic.c EXPORT_SYMBOL(drm_atomic_state_clear); · line 187

Quoted 1 line
drivers/gpu/drm/drm_atomic.c +0 -0
 	DRM_DEBUG_ATOMIC("Freeing atomic state %p\n", state);

It'd probably make sense to fix all code that uses drm_atomic_state_free() at the same time.

Imo we can do that as follow-ups as needed. Applied to topic/drm-misc, thanks.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 1/1
#3 lore raw
In reply to Ander Conselvan de Oliveira

Task id: 6092 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
PNV -1 270/270 269/270

ILK                                  303/303              303/303
SNB                                  304/304              304/304
IVB                                  337/337              337/337
BYT                                  287/287              287/287
HSW                                  361/361              361/361
BDW                                  309/309              309/309

-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
PNV igt@gem_userptr_blits@coherency-sync CRASH(3)PASS(2) CRASH(2)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx