* [Qemu-devel] [PATCH] virtio-serial-bus: fix ports_map allocation on init
@ 2010-05-19 9:31 Amit Shah
2010-06-01 18:27 ` Anthony Liguori
0 siblings, 1 reply; 2+ messages in thread
From: Amit Shah @ 2010-05-19 9:31 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Amit Shah, Alon Levy, qemu list
From: Alon Levy <alevy@redhat.com>
Fix for too small allocation to ports_map
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
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)
--
1.7.0.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] virtio-serial-bus: fix ports_map allocation on init
2010-05-19 9:31 [Qemu-devel] [PATCH] virtio-serial-bus: fix ports_map allocation on init Amit Shah
@ 2010-06-01 18:27 ` Anthony Liguori
0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2010-06-01 18:27 UTC (permalink / raw)
To: Amit Shah; +Cc: Alon Levy, qemu list
On 05/19/2010 04:31 AM, Amit Shah wrote:
> From: Alon Levy<alevy@redhat.com>
>
> Fix for too small allocation to ports_map
>
> Signed-off-by: Alon Levy<alevy@redhat.com>
> Signed-off-by: Amit Shah<amit.shah@redhat.com>
>
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)
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-01 18:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19 9:31 [Qemu-devel] [PATCH] virtio-serial-bus: fix ports_map allocation on init Amit Shah
2010-06-01 18:27 ` Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).