From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36685 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJWBc-0000qw-T8 for qemu-devel@nongnu.org; Tue, 01 Jun 2010 14:27:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJWBb-0005li-TJ for qemu-devel@nongnu.org; Tue, 01 Jun 2010 14:27:36 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:33400) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJWBb-0005lV-Pv for qemu-devel@nongnu.org; Tue, 01 Jun 2010 14:27:35 -0400 Received: by iwn41 with SMTP id 41so898200iwn.4 for ; Tue, 01 Jun 2010 11:27:34 -0700 (PDT) Message-ID: <4C05510D.6040107@codemonkey.ws> Date: Tue, 01 Jun 2010 13:27:25 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] virtio-serial-bus: fix ports_map allocation on init References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Alon Levy , qemu list On 05/19/2010 04:31 AM, Amit Shah wrote: > From: Alon Levy > > Fix for too small allocation to ports_map > > Signed-off-by: Alon Levy > Signed-off-by: Amit Shah > 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) >