While they were all just simple blobs it made sense to just free them
as we walked through and logged them. Now that there are pointers to
other objects which need refcounting, we might as well revert to
_only_ logging them in audit_log_exit(), and put the code to free them
properly in only one place -- in audit_free_aux().
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
----------------------------------------------------------
{
int i;
struct audit_buffer *ab;
+ struct audit_aux_data *aux;
ab = audit_log_start(context, AUDIT_SYSCALL);
if (!ab)
context->egid, context->sgid, context->fsgid);
audit_log_task_info(ab);
audit_log_end(ab);
- while (context->aux) {
- struct audit_aux_data *aux;
- aux = context->aux;
+ for (aux = context->aux; aux; aux = aux->next) {
ab = audit_log_start(context, aux->type);
if (!ab)
case AUDIT_AVC_PATH: {
struct audit_aux_data_path *axi = (void *)aux;
audit_log_d_path(ab, "path=", axi->dentry, axi->mnt);
- dput(axi->dentry);
- mntput(axi->mnt);
break; }
}
audit_log_end(ab);
-
- context->aux = aux->next;
- kfree(aux);
}
for (i = 0; i < context->name_count; i++) {