2009-12-01 22:15:00

by Veaceslav Falico

[permalink] [raw]
Subject: [PATCH 4/4] copy_signal cleanup: clean tty_audit_fork()

Remove unneeded initialization in tty_audit_fork().

Signed-off-by: Veaceslav Falico <[email protected]>
---

diff --git a/drivers/char/tty_audit.c b/drivers/char/tty_audit.c
index ac16fbe..283a15b 100644
--- a/drivers/char/tty_audit.c
+++ b/drivers/char/tty_audit.c
@@ -148,7 +148,6 @@ void tty_audit_fork(struct signal_struct *sig)
spin_lock_irq(&current->sighand->siglock);
sig->audit_tty = current->signal->audit_tty;
spin_unlock_irq(&current->sighand->siglock);
- sig->tty_audit_buf = NULL;
}

/**


2009-12-02 14:22:09

by Oleg Nesterov

[permalink] [raw]
Subject: Re: [PATCH 4/4] copy_signal cleanup: clean tty_audit_fork()

On 12/01, Veaceslav Falico wrote:
>
> Remove unneeded initialization in tty_audit_fork().
>
> Signed-off-by: Veaceslav Falico <[email protected]>
> ---
>
> diff --git a/drivers/char/tty_audit.c b/drivers/char/tty_audit.c
> index ac16fbe..283a15b 100644
> --- a/drivers/char/tty_audit.c
> +++ b/drivers/char/tty_audit.c
> @@ -148,7 +148,6 @@ void tty_audit_fork(struct signal_struct *sig)
> spin_lock_irq(&current->sighand->siglock);
> sig->audit_tty = current->signal->audit_tty;
> spin_unlock_irq(&current->sighand->siglock);
> - sig->tty_audit_buf = NULL;
> }

OK, but given that this function is "far" from copy_signal() path
and it is not inline, perhaps it makes sense to add the comment which
explains *sig must be zeroed, and the only caller is copy_signal().


Hmm. Off-topic, but why do we take ->siglock? ->audit_tty is boolean,
afaics ->siglock buys nothing.

Oleg.