 if (!newn) 
 if (!newn) 
static struct tnode *halve(struct trie *t, struct tnode *tn){	struct tnode *oldtnode = tn;	struct node *left, *right;	int i;	int olen = tnode_child_length(tn);	DBG("In halve\n");	tn = tnode_new(oldtnode->key, oldtnode->pos, oldtnode->bits - 1);	if (!tn)		return ERR_PTR(-ENOMEM);	/*	 * Preallocate and store tnodes before the actual work so we	 * don't get into an inconsistent state if memory allocation	 * fails. In case of failure we return the oldnode and halve	 * of tnode is ignored.	 */	for (i = 0; i < olen; i += 2) {		left = tnode_get_child(oldtnode, i);		right = tnode_get_child(oldtnode, i+1);		/* Two nonempty children */		if (left && right)  {			struct tnode *newn;  			newn = tnode_new(left->key, tn->pos + tn->bits, 1);  			if (!newn) 				goto nomem;  			put_child(t, tn, i/2, (struct node *)newn);		}	}	for (i = 0; i < olen; i += 2) {		struct tnode *newBinNode;		left = tnode_get_child(oldtnode, i);		right = tnode_get_child(oldtnode, i+1);		/* At least one of the children is empty */		if (left == NULL) {			if (right == NULL)    /* Both are empty */				continue;			put_child(t, tn, i/2, right);			continue;		} 		if (right == NULL) {			put_child(t, tn, i/2, left);			continue;		}		/* Two nonempty children */		newBinNode = (struct tnode *) tnode_get_child(tn, i/2);		put_child(t, tn, i/2, NULL);		BUG_ON(!newBinNode);		put_child(t, newBinNode, 0, left);		put_child(t, newBinNode, 1, right);		put_child(t, tn, i/2, resize(t, newBinNode));	}	tnode_free(oldtnode);	return tn;nomem:	{		int size = tnode_child_length(tn);		int j;		for(j = 0; j < size; j++)			if (tn->child[j])				tnode_free((struct tnode *)tn->child[j]);		tnode_free(tn);			return ERR_PTR(-ENOMEM);	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/0c7770c740156c8802c23d24fc094d06967d997d/fib_trie.c/buggy/net/ipv4/fib_trie.c