diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c index f64582b0f6232994f08213d3ea663e6f79acafc6..7c5866920622911ab608b4da5485ccadb487bedb 100644 --- a/drivers/tty/tty_audit.c +++ b/drivers/tty/tty_audit.c @@ -95,8 +95,10 @@ static void tty_audit_buf_push(struct task_struct *tsk, uid_t loginuid, { if (buf->valid == 0) return; - if (audit_enabled == 0) + if (audit_enabled == 0) { + buf->valid = 0; return; + } tty_audit_log("tty", tsk, loginuid, sessionid, buf->major, buf->minor, buf->data, buf->valid); buf->valid = 0;