From 1273c6165f1785093d70ac5e98e140b15bb6e0d5 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Mon, 11 Jun 2012 18:32:10 +0300 Subject: [PATCH] pf_insert: Return matching node on insert When a matching entry is found from the rb_tree, the insert function should return the found entry from the tree to the caller. This is also explicitly documented in the code. However, the code incorrectly returned NULL instead. Fix the code to return the match as it should do. Without this fix identical pageframe entries are never located. Signed-off-by: Timo Kokkonen --- treeops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/treeops.c b/treeops.c index feaca58..ff698a0 100644 --- a/treeops.c +++ b/treeops.c @@ -20,7 +20,7 @@ struct pageframe *pf_insert(struct rb_root *root, struct pageframe *pf) * tree. Return that node to indicate the * collision */ - return NULL; + return this; } /* Add new node and rebalance tree. */ -- 2.45.0