Skip to content

Commit

Permalink
virtio_console: Use kmalloc instead of kzalloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sjur Brændeland authored and Rusty Russell committed Dec 18, 2012
1 parent fe52953 commit 0127f68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ static struct port_buffer *alloc_buf(size_t buf_size)
buf = kmalloc(sizeof(*buf), GFP_KERNEL);
if (!buf)
goto fail;
buf->buf = kzalloc(buf_size, GFP_KERNEL);
buf->buf = kmalloc(buf_size, GFP_KERNEL);
if (!buf->buf)
goto free_buf;
buf->len = 0;
Expand Down

0 comments on commit 0127f68

Please sign in to comment.