From mboxrd@z Thu Jan 1 00:00:00 1970 From: Qu Wenruo Date: Sat, 31 Oct 2020 09:07:51 +0800 Subject: [PATCH 3/4] fs: btrfs: initialize @ret to 0 to prevent uninitialized return value In-Reply-To: <20201031010752.23974-1-wqu@suse.com> References: <20201031010752.23974-1-wqu@suse.com> Message-ID: <20201031010752.23974-4-wqu@suse.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In show_dir() if we hit a ROOT_ITEM, we can exit with uninitialized @ret. Fix it by initializing it to 0. Reported-by: Coverity CID 312955 Signed-off-by: Qu Wenruo --- fs/btrfs/btrfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/btrfs.c b/fs/btrfs/btrfs.c index e48972ffa21a..346b2c4341c2 100644 --- a/fs/btrfs/btrfs.c +++ b/fs/btrfs/btrfs.c @@ -36,7 +36,7 @@ static int show_dir(struct btrfs_root *root, struct extent_buffer *eb, char *target = NULL; char filetime[32]; time_t mtime; - int ret; + int ret = 0; btrfs_dir_item_key_to_cpu(eb, di, &key); -- 2.29.1