Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Aditya Swarup <aditya.swarup@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable
Date: Tue, 03 Mar 2020 17:25:21 +0200	[thread overview]
Message-ID: <87d09tpiji.fsf@intel.com> (raw)
In-Reply-To: <20200303142347.15696-1-aditya.swarup@intel.com>

On Tue, 03 Mar 2020, Aditya Swarup <aditya.swarup@intel.com> wrote:
> Static code analysis tool identified struct lrc_timestamp data as being
> uninitialized and then data.ce[] is being checked for NULL/negative
> value in the error path. Initializing data variable fixes the issue.
>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/selftest_lrc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> index ccf9debacd90..9b75b3c77a5b 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> @@ -4725,7 +4725,7 @@ static int live_lrc_timestamp(void *arg)
>  {
>  	struct intel_gt *gt = arg;
>  	enum intel_engine_id id;
> -	struct lrc_timestamp data;
> +	struct lrc_timestamp data = { 0 };

{} is preferred over {0}.

BR,
Jani.

>  	const u32 poison[] = {
>  		0,
>  		S32_MAX,

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-03-03 15:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 14:23 [Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable Aditya Swarup
2020-03-03 15:25 ` Jani Nikula [this message]
2020-03-03 20:30   ` Matt Roper
2020-03-04 10:07     ` Jani Nikula
2020-03-04 20:50       ` Jani Nikula
2020-03-03 18:45 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915/selftests: Fix uninitialized variable (rev2) Patchwork
2020-03-03 20:25 ` [Intel-gfx] [PATCH] drm/i915/selftests: Fix uninitialized variable Matt Roper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d09tpiji.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=aditya.swarup@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox