mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-20 03:04:01 +08:00
[PATCH] tty: trivial kzalloc opportunity
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
0b4a8a789a
commit
1266b1e1ae
@ -160,17 +160,11 @@ static void release_mem(struct tty_struct *tty, int idx);
|
||||
* been initialized in any way but has been zeroed
|
||||
*
|
||||
* Locking: none
|
||||
* FIXME: use kzalloc
|
||||
*/
|
||||
|
||||
static struct tty_struct *alloc_tty_struct(void)
|
||||
{
|
||||
struct tty_struct *tty;
|
||||
|
||||
tty = kmalloc(sizeof(struct tty_struct), GFP_KERNEL);
|
||||
if (tty)
|
||||
memset(tty, 0, sizeof(struct tty_struct));
|
||||
return tty;
|
||||
return kzalloc(sizeof(struct tty_struct), GFP_KERNEL);
|
||||
}
|
||||
|
||||
static void tty_buffer_free_all(struct tty_struct *);
|
||||
|
Loading…
Reference in New Issue
Block a user