aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_audit.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/tty_audit.c')
-rw-r--r--drivers/char/tty_audit.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/char/tty_audit.c b/drivers/char/tty_audit.c
index 55ba6f142883..ac16fbec72d0 100644
--- a/drivers/char/tty_audit.c
+++ b/drivers/char/tty_audit.c
@@ -29,10 +29,7 @@ static struct tty_audit_buf *tty_audit_buf_alloc(int major, int minor,
29 buf = kmalloc(sizeof(*buf), GFP_KERNEL); 29 buf = kmalloc(sizeof(*buf), GFP_KERNEL);
30 if (!buf) 30 if (!buf)
31 goto err; 31 goto err;
32 if (PAGE_SIZE != N_TTY_BUF_SIZE) 32 buf->data = kmalloc(N_TTY_BUF_SIZE, GFP_KERNEL);
33 buf->data = kmalloc(N_TTY_BUF_SIZE, GFP_KERNEL);
34 else
35 buf->data = (unsigned char *)__get_free_page(GFP_KERNEL);
36 if (!buf->data) 33 if (!buf->data)
37 goto err_buf; 34 goto err_buf;
38 atomic_set(&buf->count, 1); 35 atomic_set(&buf->count, 1);
@@ -52,10 +49,7 @@ err:
52static void tty_audit_buf_free(struct tty_audit_buf *buf) 49static void tty_audit_buf_free(struct tty_audit_buf *buf)
53{ 50{
54 WARN_ON(buf->valid != 0); 51 WARN_ON(buf->valid != 0);
55 if (PAGE_SIZE != N_TTY_BUF_SIZE) 52 kfree(buf->data);
56 kfree(buf->data);
57 else
58 free_page((unsigned long)buf->data);
59 kfree(buf); 53 kfree(buf);
60} 54}
61 55