summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2017-10-06 15:04:57 +0200
committerTom Rini <trini@konsulko.com>2017-10-16 09:42:51 -0400
commitecab881c7fcd7484420b6aa15b0f748458640191 (patch)
treee3af32cdbc612722f890a0b61b77fb7f10788064 /fs/btrfs/inode.c
parent502af618ec3d60f3c8b9914e3484f112fb295b6e (diff)
downloadu-boot-ecab881c7fcd7484420b6aa15b0f748458640191.tar.gz
u-boot-ecab881c7fcd7484420b6aa15b0f748458640191.tar.xz
u-boot-ecab881c7fcd7484420b6aa15b0f748458640191.zip
fs: btrfs: Fix usage of uninitialized variables
The variable res should be initialized to 0 in these functions, because if the searched key is not found, the variable is used uninitialized. Reported-by: Coverity (CID: 167335) Reported-by: Coverity (CID: 167336) Reported-by: Coverity (CID: 167337) Signed-off-by: Marek Behun <marek.behun@nic.cz>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 0d3da28296..0af04278a3 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -324,7 +324,7 @@ u64 btrfs_file_read(const struct btrfs_root *root, u64 inr, u64 offset,
struct btrfs_path path;
struct btrfs_key key;
struct btrfs_file_extent_item *extent;
- int res;
+ int res = 0;
u64 rd, rd_all = -1ULL;
key.objectid = inr;