Exemple #1
0
int conn_policies_destroy(struct conn_policies * cp_params)
{
        int retval = 0;

        if (!cp_params)
                return -1;

        if (cp_params->dtcp_cfg)
                if (dtcp_config_destroy(cp_params->dtcp_cfg))
                        retval = -1;

        if (cp_params->initial_sequence_number)
                if (policy_destroy(cp_params->initial_sequence_number))
                        retval = -1;

        if (cp_params->receiver_inactivity_timer)
                if (policy_destroy(cp_params->receiver_inactivity_timer))
                        retval = -1;

        if (cp_params->sender_inactivity_timer)
                if (policy_destroy(cp_params->sender_inactivity_timer))
                        retval = -1;

        rkfree(cp_params);
        return retval;
}
Exemple #2
0
/**
 * aa_free_namespace - free a profile namespace
 * @ns: the namespace to free  (MAYBE NULL)
 *
 * Requires: All references to the namespace must have been put, if the
 *           namespace was referenced by a profile confining a task,
 */
static void aa_free_namespace(struct aa_namespace *ns)
{
	if (!ns)
		return;

	policy_destroy(&ns->base);
	aa_put_namespace(ns->parent);

	if (ns->unconfined && ns->unconfined->ns == ns)
		ns->unconfined->ns = NULL;

	aa_put_profile(ns->unconfined);
	kzfree(ns);
}