[igt-dev] [PATCH igt] tools: Clear unused fields in register spec
Jani Nikula
jani.nikula at intel.com
Fri Feb 2 11:16:38 UTC 2018
On Fri, 02 Feb 2018, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> 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>
Reviewed-by: Jani Nikula <jani.nikula at 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++;
--
Jani Nikula, Intel Open Source Technology Center
More information about the igt-dev
mailing list