qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] virtio-serial-bus: fix ports_map allocation on


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] virtio-serial-bus: fix ports_map allocation on init
Date: Tue, 01 Jun 2010 13:27:25 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Lightning/1.0b1 Thunderbird/3.0.4

On 05/19/2010 04:31 AM, Amit Shah wrote:
From: Alon Levy<address@hidden>

Fix for too small allocation to ports_map

Signed-off-by: Alon Levy<address@hidden>
Signed-off-by: Amit Shah<address@hidden>

Applied.  Thanks.

Regards,

Anthony Liguori

---
  hw/virtio-serial-bus.c |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 3ce95e8..7f9d28f 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -774,7 +774,8 @@ VirtIODevice *virtio_serial_init(DeviceState *dev, uint32_t 
max_nr_ports)
      }

      vser->config.max_nr_ports = max_nr_ports;
-    vser->ports_map = qemu_mallocz((max_nr_ports + 31) / 32);
+    vser->ports_map = qemu_mallocz(((max_nr_ports + 31) / 32)
+        * sizeof(vser->ports_map[0]));
      /*
       * Reserve location 0 for a console port for backward compat
       * (old kernel, new qemu)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]