Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] btrfs: Added null check to extent_root variable
@ 2024-09-04  2:37 Ghanshyam Agrawal
  2024-09-04  5:51 ` Qu Wenruo
  0 siblings, 1 reply; 6+ messages in thread
From: Ghanshyam Agrawal @ 2024-09-04  2:37 UTC (permalink / raw)
  To: clm, josef, dsterba
  Cc: Ghanshyam Agrawal, linux-btrfs, linux-kernel,
	syzbot+9c3e0cdfbfe351b0bc0e

Reported-by: syzbot+9c3e0cdfbfe351b0bc0e@syzkaller.appspotmail.com
Closes:https://syzkaller.appspot.com/bug?extid=9c3e0cdfbfe351b0bc0e
Signed-off-by: Ghanshyam Agrawal <ghanshyam1898@gmail.com>
---
 fs/btrfs/ref-verify.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c
index 9522a8b79d22..4e98ddf5e8df 100644
--- a/fs/btrfs/ref-verify.c
+++ b/fs/btrfs/ref-verify.c
@@ -1002,6 +1002,9 @@ int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info)
 		return -ENOMEM;
 
 	extent_root = btrfs_extent_root(fs_info, 0);
+	if (!extent_root)
+		return -EIO;
+
 	eb = btrfs_read_lock_root_node(extent_root);
 	level = btrfs_header_level(eb);
 	path->nodes[level] = eb;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-04 21:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-04  2:37 [PATCH] btrfs: Added null check to extent_root variable Ghanshyam Agrawal
2024-09-04  5:51 ` Qu Wenruo
2024-09-04 15:50   ` Ghanshyam Agrawal
2024-09-04 21:25     ` Qu Wenruo
2024-09-04 17:46   ` David Sterba
2024-09-04 21:31     ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox