void aa_free_replacedby_kref(struct kref *kref);
struct aa_profile *aa_alloc_profile(const char *name);
struct aa_profile *aa_new_null_profile(struct aa_profile *parent, int hat);
+void aa_free_profile(struct aa_profile *profile);
void aa_free_profile_kref(struct kref *kref);
struct aa_profile *aa_find_child(struct aa_profile *parent, const char *name);
struct aa_profile *aa_lookup_profile(struct aa_namespace *ns, const char *name);
return NULL;
}
-static void free_profile(struct aa_profile *profile);
/**
* free_namespace - free a profile namespace
* @ns: the namespace to free (MAYBE NULL)
aa_put_namespace(ns->parent);
ns->unconfined->ns = NULL;
- free_profile(ns->unconfined);
+ aa_free_profile(ns->unconfined);
kzfree(ns);
}
}
/**
- * free_profile - free a profile
+ * aa_free_profile - free a profile
* @profile: the profile to free (MAYBE NULL)
*
* Free a profile, its hats and null_profile. All references to the profile,
* If the profile was referenced from a task context, free_profile() will
* be called from an rcu callback routine, so we must not sleep here.
*/
-static void free_profile(struct aa_profile *profile)
+void aa_free_profile(struct aa_profile *profile)
{
AA_DEBUG("%s(%p)\n", __func__, profile);
if (p->flags & PFLAG_NS_COUNT)
free_namespace(p->ns);
else
- free_profile(p);
+ aa_free_profile(p);
}
/**
else if (!name)
name = "unknown";
audit_iface(profile, name, "failed to unpack profile", e, error);
- aa_put_profile(profile);
+ aa_free_profile(profile);
return ERR_PTR(error);
}
error = verify_profile(profile);
if (error) {
- aa_put_profile(profile);
+ aa_free_profile(profile);
goto fail;
}