summaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2020-10-31 09:07:51 +0800
committerTom Rini <trini@konsulko.com>2020-11-19 09:45:49 -0500
commit4891c4e595b48ee41b7d8062bb599d05a938ea0a (patch)
treeb2b9c37a873ded4d9facb8c2e8e39f1b523d0de3 /fs/btrfs
parent9b5546c37ab020039f06855eae28fbd56adb096b (diff)
downloadu-boot-4891c4e595b48ee41b7d8062bb599d05a938ea0a.tar.gz
fs: btrfs: initialize @ret to 0 to prevent uninitialized return value
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 <wqu@suse.com> Reviewed-by: Marek BehĂșn <marek.behun@nic.cz>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/btrfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/btrfs.c b/fs/btrfs/btrfs.c
index e48972ffa2..346b2c4341 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);