Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146270
b: refs/heads/master
c: c481c70
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Jun 11, 2009
1 parent 4d823b0 commit d1a1443
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aba6593bf77371e71331ba76dacc98b47760cba3
refs/heads/master: c481c707fe4b07783d9a2499a9bbbb94497e9b18
11 changes: 2 additions & 9 deletions trunk/drivers/char/n_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 2 additions & 8 deletions trunk/drivers/char/tty_audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -52,10 +49,7 @@ static struct tty_audit_buf *tty_audit_buf_alloc(int major, int minor,
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);
}

Expand Down

0 comments on commit d1a1443

Please sign in to comment.