Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	intel-xe@lists.freedesktop.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] drm/xe: Ensure 'passed' variable is always initialized
Date: Mon, 18 Dec 2023 20:29:21 +0000	[thread overview]
Message-ID: <ZYCrocwFzTdOuPzz@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20231218163818.1700983-1-rodrigo.vivi@intel.com>

On Mon, Dec 18, 2023 at 11:38:18AM -0500, Rodrigo Vivi wrote:
> Although the path should be impossible, some static analyzers
> and compilers might not like the fact that there is a path
> where 'passed' variable is not initialized.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202312170357.KPSinwPs-lkp@intel.com/
> Fixes: ad7d86415578 ("drm/xe: Enable W=1 warnings by default")
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

Reviewed-by: Matthew Brost <matthew.brost@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_wait_user_fence.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_wait_user_fence.c b/drivers/gpu/drm/xe/xe_wait_user_fence.c
> index b0a7896f7fcb6..b2e76331bfa73 100644
> --- a/drivers/gpu/drm/xe/xe_wait_user_fence.c
> +++ b/drivers/gpu/drm/xe/xe_wait_user_fence.c
> @@ -19,7 +19,7 @@ static int do_compare(u64 addr, u64 value, u64 mask, u16 op)
>  {
>  	u64 rvalue;
>  	int err;
> -	bool passed;
> +	bool passed = 0;
>  
>  	err = copy_from_user(&rvalue, u64_to_user_ptr(addr), sizeof(rvalue));
>  	if (err)
> -- 
> 2.43.0
> 

  reply	other threads:[~2023-12-18 20:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 16:38 [PATCH] drm/xe: Ensure 'passed' variable is always initialized Rodrigo Vivi
2023-12-18 20:29 ` Matthew Brost [this message]
2023-12-19  3:36 ` ✓ CI.Patch_applied: success for " Patchwork
2023-12-19  3:36 ` ✗ CI.checkpatch: warning " Patchwork
2023-12-19  3:37 ` ✓ CI.KUnit: success " Patchwork
2023-12-19  3:44 ` ✓ CI.Build: " Patchwork
2023-12-19  3:45 ` ✓ CI.Hooks: " Patchwork
2023-12-19  3:46 ` ✓ CI.checksparse: " Patchwork
2023-12-19  4:21 ` ✓ CI.BAT: " Patchwork

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=ZYCrocwFzTdOuPzz@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lkp@intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /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