diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 8ca3878348ffe110d296a15cb695341d42b16bb2..1d4e0a65494aa79c26d4f173d2b47e2060cf2607 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5664,7 +5664,7 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
 	struct inode *inode;
 	struct btrfs_root *root = BTRFS_I(dir)->root;
 	struct btrfs_root *sub_root = root;
-	struct btrfs_key location;
+	struct btrfs_key location = { 0 };
 	u8 di_type = 0;
 	int ret = 0;