All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: fix segfault in walk_down_tree
@ 2013-05-02  2:46 Lin Ming
  2013-05-02  4:32 ` Eric Sandeen
  0 siblings, 1 reply; 3+ messages in thread
From: Lin Ming @ 2013-05-02  2:46 UTC (permalink / raw)
  To: linux-btrfs

walk_down_tree will fault when read_tree_block fails with NULL returned.

Signed-off-by: Lin Ming <mlin@kernel.org>
---
 cmds-check.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/cmds-check.c b/cmds-check.c
index 12192fa..e4435d5 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -1256,6 +1256,8 @@ static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
 			reada_walk_down(root, cur, path->slots[*level]);
 			next = read_tree_block(root, bytenr, blocksize,
 					       ptr_gen);
+			if (!next)
+				goto out;
 		}
 
 		*level = *level - 1;
-- 
1.7.2.5


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

end of thread, other threads:[~2013-05-02 15:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-02  2:46 [PATCH] btrfs-progs: fix segfault in walk_down_tree Lin Ming
2013-05-02  4:32 ` Eric Sandeen
2013-05-02 15:32   ` Lin Ming

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.