/* This function returns a pointer to the nnode found or NULL if no nnode is found. This function is a helper to 'ubifs_lpt_free()'.  */
static struct ubifs_nnode* first_nnode(struct ubifs_info *c, int *hght)
/* This function returns a pointer to the nnode found or NULL if no nnode is found. This function is a helper to 'ubifs_lpt_free()'.  */
static struct ubifs_nnode* first_nnode(struct ubifs_info *c, int *hght)
{
	struct ubifs_nnode *nnode;
	int h, i, found;
	nnode = c->nroot;
	*hght = 0;
	if (!nnode)
		return NULL;
	for (h = 1; h < c->lpt_hght; h++) {
		found = 0;
		for (i = 0; i < UBIFS_LPT_FANOUT; i++) {
			if (nnode->nbranch[i].nnode) {
				found = 1;
				nnode = nnode->nbranch[i].nnode;
				*hght = h;
				break;
			}
		}
		if (!found)
			break;
	}
	return nnode;
}