[17/18] btrfs: add NULL check for build_backref_tree()
diff mbox

Message ID 4BAB5916.2030206@cn.fujitsu.com
State New, archived
Headers show

Commit Message

Miao Xie March 25, 2010, 12:37 p.m. UTC
None

Patch
diff mbox

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 0b23942..6737803 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -816,8 +816,10 @@  next:
 			list_add_tail(&edge->list[UPPER], &list);
 	}
 out:
-	btrfs_free_path(path1);
-	btrfs_free_path(path2);
+	if (path1)
+		btrfs_free_path(path1);
+	if (path2)
+		btrfs_free_path(path2);
 	if (err) {
 		INIT_LIST_HEAD(&list);
 		upper = node;