diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/n_tty.c | 11 | ||||
-rw-r--r-- | drivers/char/tty_audit.c | 10 |
2 files changed, 4 insertions, 17 deletions
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index f6f0e4ec2b5..b4b12b4f0ac 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -76,19 +76,12 @@ static inline unsigned char *alloc_buf(void) { gfp_t prio = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL; - - if (PAGE_SIZE != N_TTY_BUF_SIZE) - return kmalloc(N_TTY_BUF_SIZE, prio); - else - return (unsigned char *)__get_free_page(prio); + return kmalloc(N_TTY_BUF_SIZE, prio); } static inline void free_buf(unsigned char *buf) { - if (PAGE_SIZE != N_TTY_BUF_SIZE) - kfree(buf); - else - free_page((unsigned long) buf); + kfree(buf); } static inline int tty_put_user(struct tty_struct *tty, unsigned char x, diff --git a/drivers/char/tty_audit.c b/drivers/char/tty_audit.c index 55ba6f14288..ac16fbec72d 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, buf = kmalloc(sizeof(*buf), GFP_KERNEL); if (!buf) goto err; - if (PAGE_SIZE != N_TTY_BUF_SIZE) - buf->data = kmalloc(N_TTY_BUF_SIZE, GFP_KERNEL); - else - buf->data = (unsigned char *)__get_free_page(GFP_KERNEL); + buf->data = kmalloc(N_TTY_BUF_SIZE, GFP_KERNEL); if (!buf->data) goto err_buf; atomic_set(&buf->count, 1); @@ -52,10 +49,7 @@ err: static void tty_audit_buf_free(struct tty_audit_buf *buf) { WARN_ON(buf->valid != 0); - if (PAGE_SIZE != N_TTY_BUF_SIZE) - kfree(buf->data); - else - free_page((unsigned long)buf->data); + kfree(buf->data); kfree(buf); } |