Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4fdb61e authored by Wang Shilong's avatar Wang Shilong Committed by Chris Mason
Browse files

Btrfs: fix possible memory leak in find_parent_nodes()

parent 09fb99a6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -911,7 +911,6 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,

	while (!list_empty(&prefs)) {
		ref = list_first_entry(&prefs, struct __prelim_ref, list);
		list_del(&ref->list);
		WARN_ON(ref->count < 0);
		if (ref->count && ref->root_id && ref->parent == 0) {
			/* no parent == root of tree */
@@ -956,6 +955,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
				eie->next = ref->inode_list;
			}
		}
		list_del(&ref->list);
		kfree(ref);
	}