]> Git Repo - linux.git/commitdiff
drm/i915: Pair va_copy with va_end in i915_error_vprintf
authorMika Kuoppala <[email protected]>
Fri, 7 Feb 2014 15:40:50 +0000 (17:40 +0200)
committerDaniel Vetter <[email protected]>
Tue, 11 Feb 2014 10:53:15 +0000 (11:53 +0100)
Each invocation of va_copy() must be matched by a corresponding
invocation of va_end() in the same function.

This regression has been introduced in

commit e29bb4ebbf000ff9ac081d29784a3331618f012e
Author: Chris Wilson <[email protected]>
Date:   Fri Sep 20 10:20:59 2013 +0100

    drm/i915: Use a temporary va_list for two-pass string handling

Signed-off-by: Mika Kuoppala <[email protected]>
Reviewed-by: Chris Wilson <[email protected]>
Cc: [email protected]
Signed-off-by: Daniel Vetter <[email protected]>
drivers/gpu/drm/i915/i915_gpu_error.c

index d7fd2fd2f0a5e1ba6ed25f9a4dce0c20dc03b9e3..990cf8f43efda908ecb1565cb5e8a786efe68306 100644 (file)
@@ -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;
        }
 
This page took 0.057988 seconds and 4 git commands to generate.