public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Pavel Reichl <preichl@redhat.com>
Cc: linux-xfs@vger.kernel.org, cem@redhat.com
Subject: Re: [PATCH 1/2] xfs_db: Fix uninicialized error variable
Date: Thu, 30 May 2024 15:50:05 -0700	[thread overview]
Message-ID: <20240530225005.GB52987@frogsfrogsfrogs> (raw)
In-Reply-To: <20240530223819.135697-2-preichl@redhat.com>

On Fri, May 31, 2024 at 12:38:18AM +0200, Pavel Reichl wrote:
> To silence redhat's covscan checker:
> 
> Error: UNINIT (CWE-457): [#def1] [important]
> xfsprogs-6.4.0/db/hash.c:308:2: var_decl: Declaring variable "error" without initializer.
> xfsprogs-6.4.0/db/hash.c:353:2: uninit_use: Using uninitialized value "error".
> 
> Signed-off-by: Pavel Reichl <preichl@redhat.com>

Looks good,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  db/hash.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/db/hash.c b/db/hash.c
> index 05a94f24..9b3fdea6 100644
> --- a/db/hash.c
> +++ b/db/hash.c
> @@ -304,7 +304,7 @@ collide_xattrs(
>  	struct dup_table	*tab = NULL;
>  	xfs_dahash_t		old_hash;
>  	unsigned long		i;
> -	int			error;
> +	int			error = 0;
>  
>  	old_hash = libxfs_da_hashname((uint8_t *)name, namelen);
>  
> -- 
> 2.45.1
> 
> 

  reply	other threads:[~2024-05-30 22:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-30 22:38 [PATCH 0/2] xfsprogs: Fix some issues found by checker Pavel Reichl
2024-05-30 22:38 ` [PATCH 1/2] xfs_db: Fix uninicialized error variable Pavel Reichl
2024-05-30 22:50   ` Darrick J. Wong [this message]
2024-05-31  7:49   ` Christoph Hellwig
2024-05-30 22:38 ` [PATCH 2/2] xfs_io: Fix do not loop through uninitialized var Pavel Reichl
2024-05-30 22:48   ` Darrick J. Wong
2024-05-31  9:12     ` Carlos Maiolino

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=20240530225005.GB52987@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=preichl@redhat.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