/* Returns 0 on success or a negative error code.  */
int nla_validate(struct nlattr *head, int len, int maxtype, const struct nla_policy *policy)
/* Returns 0 on success or a negative error code.  */
int nla_validate(struct nlattr *head, int len, int maxtype, const struct nla_policy *policy)
{
	struct nlattr *nla;
	int rem, err;
	nla_for_each_attr(nla, head, len, rem) {
		err = validate_nla(nla, maxtype, policy);
		if (err < 0)
			goto errout;
	}
	err = 0;
errout:
	return err;
}