aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorSjur Brændeland <sjur.brandeland@stericsson.com>2012-10-15 03:57:34 -0400
committerRusty Russell <rusty@rustcorp.com.au>2012-12-17 23:50:39 -0500
commit0127f6855e643c6b8fd5fbe3b5fa23c9d26cd237 (patch)
tree3f4d424926d3cceb7f70d62a79d25fc8e85d4fea /drivers/char
parentfe5295374ec9ac56ba3b619c5c1792b3fd66d859 (diff)
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>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/virtio_console.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 09d193dbb233..eecb1f9e2e6b 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -349,7 +349,7 @@ static struct port_buffer *alloc_buf(size_t buf_size)
349 buf = kmalloc(sizeof(*buf), GFP_KERNEL); 349 buf = kmalloc(sizeof(*buf), GFP_KERNEL);
350 if (!buf) 350 if (!buf)
351 goto fail; 351 goto fail;
352 buf->buf = kzalloc(buf_size, GFP_KERNEL); 352 buf->buf = kmalloc(buf_size, GFP_KERNEL);
353 if (!buf->buf) 353 if (!buf->buf)
354 goto free_buf; 354 goto free_buf;
355 buf->len = 0; 355 buf->len = 0;