Skip to contentSkip to conversation

drm/i915: Pair va_copy with va_end in i915_error_vprintf

PATCH In review Mika Kuoppala 3 participants 3 messages Feb 7, 2014

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

PATCH 1/1 drm/i915: Pair va_copy with va_end in i915_error_vprintf

Each invocation of va_copy() must be matched by a corresponding invocation of va_end() in the same function.

---
 drivers/gpu/drm/i915/i915_gpu_error.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gpu_error.c +4 -1
index dc47bb9..000b369 100644
@@ -146,7 +146,10 @@ static void i915_error_vprintf(struct drm_i915_error_state_buf *e,
 		va_list tmp;
 
 		va_copy(tmp, args);
-		if (!__i915_error_seek(e, vsnprintf(NULL, 0, f, tmp)))
+		len = vsnprintf(NULL, 0, f, tmp);
+		va_end(tmp);
+
+		if (!__i915_error_seek(e, len))
 			return;
 	}
 
Signature · 1 line
1.7.9.5
#2 lore raw
Quoted 8 lines · Chris Wilson
Quoted 4 lines · Mika Kuoppala

Each invocation of va_copy() must be matched by a corresponding invocation of va_end() in the same function.

Though it looks like it was my fauly anyway.

I've added the regression notice and cc: stable (since the original patch is in 3.12 and also cc: stable). Thanks for the patch. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch