Browse Source

virtio_console: Use kmalloc instead of kzalloc

Avoid the more cpu expensive kzalloc when allocating buffers.
Originally kzalloc was intended for isolating the guest from
the host by not sending random guest data to the host. But device
isolation is not yet in place so kzalloc is not really needed.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Sjur Brændeland 13 years ago
parent
commit
0127f6855e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/char/virtio_console.c

+ 1 - 1
drivers/char/virtio_console.c

@@ -349,7 +349,7 @@ static struct port_buffer *alloc_buf(size_t buf_size)
 	buf = kmalloc(sizeof(*buf), GFP_KERNEL);
 	buf = kmalloc(sizeof(*buf), GFP_KERNEL);
 	if (!buf)
 	if (!buf)
 		goto fail;
 		goto fail;
-	buf->buf = kzalloc(buf_size, GFP_KERNEL);
+	buf->buf = kmalloc(buf_size, GFP_KERNEL);
 	if (!buf->buf)
 	if (!buf->buf)
 		goto free_buf;
 		goto free_buf;
 	buf->len = 0;
 	buf->len = 0;