}
bool aa_policy_init(struct aa_policy *policy, const char *prefix,
- const char *name);
+ const char *name, gfp_t gfp);
void aa_policy_destroy(struct aa_policy *policy);
#endif /* AA_LIB_H */
* Returns: true if policy init successful
*/
bool aa_policy_init(struct aa_policy *policy, const char *prefix,
- const char *name)
+ const char *name, gfp_t gfp)
{
/* freed by policy_free */
if (prefix) {
policy->hname = kmalloc(strlen(prefix) + strlen(name) + 3,
- GFP_KERNEL);
+ gfp);
if (policy->hname)
sprintf((char *)policy->hname, "%s//%s", prefix, name);
} else
- policy->hname = kstrdup(name, GFP_KERNEL);
+ policy->hname = kstrdup(name, gfp);
if (!policy->hname)
return 0;
/* base.name is a substring of fqname */
- policy->name = (char *)basename(policy->hname);
+ policy->name = basename(policy->hname);
INIT_LIST_HEAD(&policy->list);
INIT_LIST_HEAD(&policy->profiles);
goto fail;
kref_init(&profile->proxy->count);
- if (!aa_policy_init(&profile->base, NULL, hname))
+ if (!aa_policy_init(&profile->base, NULL, hname, GFP_KERNEL))
goto fail;
kref_init(&profile->count);
AA_DEBUG("%s(%p)\n", __func__, ns);
if (!ns)
return NULL;
- if (!aa_policy_init(&ns->base, prefix, name))
+ if (!aa_policy_init(&ns->base, prefix, name, GFP_KERNEL))
goto fail_ns;
INIT_LIST_HEAD(&ns->sub_ns);