From: Qu Wenruo Date: Sat, 31 Oct 2020 01:07:51 +0000 (+0800) Subject: fs: btrfs: initialize @ret to 0 to prevent uninitialized return value X-Git-Url: http://git.dujemihanovic.xyz/img/static/gitweb.css?a=commitdiff_plain;h=4891c4e595b48ee41b7d8062bb599d05a938ea0a;p=u-boot.git 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 Reviewed-by: Marek BehĂșn --- 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);