drm/i915: Nul-terminate legacy debug string
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 17 May 2018 15:28:24 +0000 (16:28 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 17 May 2018 19:50:28 +0000 (20:50 +0100)
Make sure that when we don't have any scheduler attributes for the
request, the string is terminated.

Fixes: 247870ac8ea7 ("drm/i915: Build request info on stack before printk")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180517152824.11619-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_engine_cs.c

index d4e159a..e78c6e7 100644 (file)
@@ -1143,7 +1143,7 @@ static void print_request(struct drm_printer *m,
                          const char *prefix)
 {
        const char *name = rq->fence.ops->get_timeline_name(&rq->fence);
-       char buf[80];
+       char buf[80] = "";
        int x = 0;
 
        x = print_sched_attr(rq->i915, &rq->sched.attr, buf, x, sizeof(buf));