{
        const struct nft_rbtree *priv = nft_set_priv(set);
        const struct nft_rbtree_elem *rbe, *interval = NULL;
-       const struct rb_node *parent = priv->root.rb_node;
+       const struct rb_node *parent;
        int d;
 
        spin_lock_bh(&nft_rbtree_lock);
+       parent = priv->root.rb_node;
        while (parent != NULL) {
                rbe = rb_entry(parent, struct nft_rbtree_elem, node);
 
        struct nft_rbtree_elem *rbe;
        int d;
 
-       spin_lock_bh(&nft_rbtree_lock);
        while (parent != NULL) {
                rbe = rb_entry(parent, struct nft_rbtree_elem, node);
 
                            !(rbe->flags & NFT_SET_ELEM_INTERVAL_END))
                                nft_data_copy(&elem->data, rbe->data);
                        elem->flags = rbe->flags;
-                       spin_unlock_bh(&nft_rbtree_lock);
                        return 0;
                }
        }
-       spin_unlock_bh(&nft_rbtree_lock);
        return -ENOENT;
 }