/* Make sure no audit data is pending for @tty on the current process.  */
void tty_audit_push(struct tty_struct *tty)
/* Make sure no audit data is pending for @tty on the current process.  */
void tty_audit_push(struct tty_struct *tty)
{
	struct tty_audit_buf *buf;
	spin_lock_irq(&current->sighand->siglock);
	if (likely(!current->signal->audit_tty)) {
		spin_unlock_irq(&current->sighand->siglock);
		return;
	}
	buf = current->signal->tty_audit_buf;
	if (buf)
		atomic_inc(&buf->count);
	spin_unlock_irq(&current->sighand->siglock);
	if (buf) {
		int major, minor;
		major = tty->driver->major;
		minor = tty->driver->minor_start + tty->index;
		mutex_lock(&buf->mutex);
		if (buf->major == major && buf->minor == minor)
			tty_audit_buf_push_current(buf);
		mutex_unlock(&buf->mutex);
		tty_audit_buf_put(buf);
	}
}