Skip to contentSkip to conversation

btrfs: add NULL check for build_backref_tree()

PATCH In review Miao Xie 1 participant 1 message Mar 25, 2010 Btrfs file system

lore
Share & tools
lore

Miao Xie

author
#0 lore raw

PATCH 17/18 btrfs: add NULL check for build_backref_tree()

From: Miao Xie <[email protected]>

if passing NULL to btrfs_free_path(),oops will happen. so we must check the pointer passed to it.

---
 fs/btrfs/relocation.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
fs/btrfs/relocation.c +4 -2
index 0b23942..6737803 100644
@@ -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;
Signature · 1 line
1.6.5.2