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

Commit 550e29bc authored by Robert Olsson's avatar Robert Olsson Committed by David S. Miller
Browse files

[FIB_TRIE]: Fix leaf freeing.



Seems like leaf (end-nodes) has been freed by __tnode_free_rcu and not
by __leaf_free_rcu. This fixes the problem. Only tnode_free is now
used which checks for appropriate node type. free_leaf can be removed.

Signed-off-by: default avatarRobert Olsson <robert.olsson@its.uu.se>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8bf4b8a1
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@
 *		Patrick McHardy <kaber@trash.net>
 */

#define VERSION "0.406"
#define VERSION "0.407"

#include <linux/config.h>
#include <asm/uaccess.h>
@@ -314,11 +314,6 @@ static void __leaf_free_rcu(struct rcu_head *head)
	kfree(container_of(head, struct leaf, rcu));
}

static inline void free_leaf(struct leaf *leaf)
{
	call_rcu(&leaf->rcu, __leaf_free_rcu);
}

static void __leaf_info_free_rcu(struct rcu_head *head)
{
	kfree(container_of(head, struct leaf_info, rcu));
@@ -357,6 +352,11 @@ static void __tnode_free_rcu(struct rcu_head *head)

static inline void tnode_free(struct tnode *tn)
{
	if(IS_LEAF(tn)) {
		struct leaf *l = (struct leaf *) tn;
		call_rcu_bh(&l->rcu, __leaf_free_rcu);
	}
        else
		call_rcu(&tn->rcu, __tnode_free_rcu);
}