Commit 1266b1e1 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] tty: trivial kzalloc opportunity

Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0b4a8a78
...@@ -160,17 +160,11 @@ static void release_mem(struct tty_struct *tty, int idx); ...@@ -160,17 +160,11 @@ static void release_mem(struct tty_struct *tty, int idx);
* been initialized in any way but has been zeroed * been initialized in any way but has been zeroed
* *
* Locking: none * Locking: none
* FIXME: use kzalloc
*/ */
static struct tty_struct *alloc_tty_struct(void) static struct tty_struct *alloc_tty_struct(void)
{ {
struct tty_struct *tty; return kzalloc(sizeof(struct tty_struct), GFP_KERNEL);
tty = kmalloc(sizeof(struct tty_struct), GFP_KERNEL);
if (tty)
memset(tty, 0, sizeof(struct tty_struct));
return tty;
} }
static void tty_buffer_free_all(struct tty_struct *); static void tty_buffer_free_all(struct tty_struct *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment