Skip to content

Commit

Permalink
hvc_console: Use kzalloc() instead of kmalloc() + memset()
Browse files Browse the repository at this point in the history
Replace kmalloc() + memset()  with kzalloc().

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Milton Miller authored and Benjamin Herrenschmidt committed Jan 13, 2009
1 parent da9dc13 commit 2da7582
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/char/hvc_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,13 +765,11 @@ struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int data,
return ERR_PTR(err);
}

hp = kmalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size,
hp = kzalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size,
GFP_KERNEL);
if (!hp)
return ERR_PTR(-ENOMEM);

memset(hp, 0x00, sizeof(*hp));

hp->vtermno = vtermno;
hp->data = data;
hp->ops = ops;
Expand Down

0 comments on commit 2da7582

Please sign in to comment.