diff --git a/module/avl/avl.c b/module/avl/avl.c index b788ed28a4..9b74531fa9 100644 --- a/module/avl/avl.c +++ b/module/avl/avl.c @@ -108,6 +108,10 @@ #include #include +#ifndef _KERNEL +#include +#endif + /* * Walk from one node to the previous valued node (ie. an infix walk * towards the left). At any given node we do one of 2 things: @@ -695,7 +699,7 @@ avl_remove(avl_tree_t *tree, void *data) */ tmp = *node; - *node = *delete; + memcpy(node, delete, sizeof (*node)); if (node->avl_child[left] == node) node->avl_child[left] = &tmp;