Commit 4891c4e5 authored by Qu Wenruo's avatar Qu Wenruo Committed by Tom Rini
Browse files

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: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarMarek Behún <marek.behun@nic.cz>
parent 9b5546c3
...@@ -36,7 +36,7 @@ static int show_dir(struct btrfs_root *root, struct extent_buffer *eb, ...@@ -36,7 +36,7 @@ static int show_dir(struct btrfs_root *root, struct extent_buffer *eb,
char *target = NULL; char *target = NULL;
char filetime[32]; char filetime[32];
time_t mtime; time_t mtime;
int ret; int ret = 0;
btrfs_dir_item_key_to_cpu(eb, di, &key); btrfs_dir_item_key_to_cpu(eb, di, &key);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment