summaryrefslogtreecommitdiff
path: root/drivers/serial/serial_core.c
diff options
context:
space:
mode:
authorBurman Yan <yan_952@hotmail.com>2007-02-14 11:33:07 +0300
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-14 19:09:52 +0300
commit8f31bb39ec2a5622974666c72257e74c22492602 (patch)
tree48f38c994f02c8699fe2a69599e8cc1bc8d36ea8 /drivers/serial/serial_core.c
parent3689a0ec60bc8f56cc372c1dfa0d89dab48f7c9c (diff)
downloadlinux-8f31bb39ec2a5622974666c72257e74c22492602.tar.xz
[PATCH] serial: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial/serial_core.c')
-rw-r--r--drivers/serial/serial_core.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 66fdd3b2b958..0422c0f1f852 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1523,9 +1523,8 @@ static struct uart_state *uart_get(struct uart_driver *drv, int line)
}
if (!state->info) {
- state->info = kmalloc(sizeof(struct uart_info), GFP_KERNEL);
+ state->info = kzalloc(sizeof(struct uart_info), GFP_KERNEL);
if (state->info) {
- memset(state->info, 0, sizeof(struct uart_info));
init_waitqueue_head(&state->info->open_wait);
init_waitqueue_head(&state->info->delta_msr_wait);
@@ -2178,13 +2177,11 @@ int uart_register_driver(struct uart_driver *drv)
* Maybe we should be using a slab cache for this, especially if
* we have a large number of ports to handle.
*/
- drv->state = kmalloc(sizeof(struct uart_state) * drv->nr, GFP_KERNEL);
+ drv->state = kzalloc(sizeof(struct uart_state) * drv->nr, GFP_KERNEL);
retval = -ENOMEM;
if (!drv->state)
goto out;
- memset(drv->state, 0, sizeof(struct uart_state) * drv->nr);
-
normal = alloc_tty_driver(drv->nr);
if (!normal)
goto out;