[igt-dev] [PATCH igt] tools: Clear unused fields in register spec

Mika Kuoppala mika.kuoppala at linux.intel.com
Fri Feb 2 13:06:39 UTC 2018


Chris Wilson <chris at chris-wilson.co.uk> writes:

> If we fail to clear the other fields inside the register spec, that may
> be left with garbage instructing us to access the register via an
> invalid path.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104895
> Fixes: 7f0be0e7d9be ("tools/intel_reg: Add reading and writing registers through engine")
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Jani Nikula <jani.nikula at intel.com>
> CC: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> ---

I mailed a separate patch which does handle the builting spec,
which is more precise the bug#104895. But this is needed also
as it is for the same problem with file based reg specs.

We need both.

Reviewed-by: Mika Kuoppala <mika.kuoppala at linux.intel.com>

>  tools/intel_reg_spec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/intel_reg_spec.c b/tools/intel_reg_spec.c
> index 5594d7077..58c8f7e4c 100644
> --- a/tools/intel_reg_spec.c
> +++ b/tools/intel_reg_spec.c
> @@ -267,7 +267,7 @@ static ssize_t parse_file(struct reg **regs, size_t *nregs,
>  	}
>  
>  	while (getline(&line, &linesize, file) != -1) {
> -		struct reg reg;
> +		struct reg reg = {};
>  
>  		lineno++;
>  
> -- 
> 2.15.1


More information about the igt-dev mailing list