aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_core.c
diff options
context:
space:
mode:
authorBurman Yan <yan_952@hotmail.com>2007-02-14 03:33:07 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-14 11:09:52 -0500
commit8f31bb39ec2a5622974666c72257e74c22492602 (patch)
tree48f38c994f02c8699fe2a69599e8cc1bc8d36ea8 /drivers/serial/serial_core.c
parent3689a0ec60bc8f56cc372c1dfa0d89dab48f7c9c (diff)
[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 66fdd3b2b95..0422c0f1f85 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)
1523 } 1523 }
1524 1524
1525 if (!state->info) { 1525 if (!state->info) {
1526 state->info = kmalloc(sizeof(struct uart_info), GFP_KERNEL); 1526 state->info = kzalloc(sizeof(struct uart_info), GFP_KERNEL);
1527 if (state->info) { 1527 if (state->info) {
1528 memset(state->info, 0, sizeof(struct uart_info));
1529 init_waitqueue_head(&state->info->open_wait); 1528 init_waitqueue_head(&state->info->open_wait);
1530 init_waitqueue_head(&state->info->delta_msr_wait); 1529 init_waitqueue_head(&state->info->delta_msr_wait);
1531 1530
@@ -2178,13 +2177,11 @@ int uart_register_driver(struct uart_driver *drv)
2178 * Maybe we should be using a slab cache for this, especially if 2177 * Maybe we should be using a slab cache for this, especially if
2179 * we have a large number of ports to handle. 2178 * we have a large number of ports to handle.
2180 */ 2179 */
2181 drv->state = kmalloc(sizeof(struct uart_state) * drv->nr, GFP_KERNEL); 2180 drv->state = kzalloc(sizeof(struct uart_state) * drv->nr, GFP_KERNEL);
2182 retval = -ENOMEM; 2181 retval = -ENOMEM;
2183 if (!drv->state) 2182 if (!drv->state)
2184 goto out; 2183 goto out;
2185 2184
2186 memset(drv->state, 0, sizeof(struct uart_state) * drv->nr);
2187
2188 normal = alloc_tty_driver(drv->nr); 2185 normal = alloc_tty_driver(drv->nr);
2189 if (!normal) 2186 if (!normal)
2190 goto out; 2187 goto out;