diff mbox

drm/i915: Nul-terminate legacy debug string

Message ID 20180517152824.11619-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson May 17, 2018, 3:28 p.m. UTC
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>
---
 drivers/gpu/drm/i915/intel_engine_cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ville Syrjälä May 17, 2018, 7:06 p.m. UTC | #1
On Thu, May 17, 2018 at 04:28:24PM +0100, Chris Wilson wrote:
> 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>

> ---
>  drivers/gpu/drm/i915/intel_engine_cs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index d4e159ae65a6..e78c6e769e8c 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -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));
> -- 
> 2.17.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Chris Wilson May 17, 2018, 9:14 p.m. UTC | #2
Quoting Ville Syrjälä (2018-05-17 20:06:28)
> On Thu, May 17, 2018 at 04:28:24PM +0100, Chris Wilson wrote:
> > 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>

Thanks for the review, pushed before I have to read any more garbage in
the CI logs.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index d4e159ae65a6..e78c6e769e8c 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -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));