audit: audit_context pid unused, context enum comment fix
authorRichard Guy Briggs <rgb@redhat.com>
Thu, 25 Aug 2022 19:32:37 +0000 (15:32 -0400)
committerPaul Moore <paul@paul-moore.com>
Fri, 26 Aug 2022 21:06:00 +0000 (17:06 -0400)
The pid member of struct audit_context is never used.  Remove it.

The audit_reset_context() comment about unconditionally resetting
"ctx->state" should read "ctx->context".

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
kernel/audit.h
kernel/auditsc.c

index 58b66543b4d57e6542f97900cc7809f4aea7de61..d6eb7b59c791be644af967962a5bfadbd0710259 100644 (file)
@@ -133,7 +133,7 @@ struct audit_context {
        struct sockaddr_storage *sockaddr;
        size_t sockaddr_len;
                                /* Save things to print about task_struct */
-       pid_t               pid, ppid;
+       pid_t               ppid;
        kuid_t              uid, euid, suid, fsuid;
        kgid_t              gid, egid, sgid, fsgid;
        unsigned long       personality;
index 9226746dcf0a06793d46b9d5022dd0d926069b2c..21e50e6d0fc07f38da3ff80570cf23edf65de87f 100644 (file)
@@ -965,7 +965,7 @@ static void audit_reset_context(struct audit_context *ctx)
        if (!ctx)
                return;
 
-       /* if ctx is non-null, reset the "ctx->state" regardless */
+       /* if ctx is non-null, reset the "ctx->context" regardless */
        ctx->context = AUDIT_CTX_UNUSED;
        if (ctx->dummy)
                return;
@@ -1002,7 +1002,7 @@ static void audit_reset_context(struct audit_context *ctx)
        kfree(ctx->sockaddr);
        ctx->sockaddr = NULL;
        ctx->sockaddr_len = 0;
-       ctx->pid = ctx->ppid = 0;
+       ctx->ppid = 0;
        ctx->uid = ctx->euid = ctx->suid = ctx->fsuid = KUIDT_INIT(0);
        ctx->gid = ctx->egid = ctx->sgid = ctx->fsgid = KGIDT_INIT(0);
        ctx->personality = 0;