* [PATCH] ioemu: Initialize ioport_opaque to zero
@ 2008-03-19 17:02 Samuel Thibault
2008-03-19 17:07 ` Samuel Thibault
0 siblings, 1 reply; 2+ messages in thread
From: Samuel Thibault @ 2008-03-19 17:02 UTC (permalink / raw)
To: xen-devel
ioemu: Initialize ioport_opaque to zero
since register_ioport_read requires it.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
diff -r b3c8dcb98543 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c Wed Mar 19 16:25:52 2008 +0000
+++ b/tools/ioemu/vl.c Wed Mar 19 17:01:36 2008 +0000
@@ -281,7 +281,7 @@ void default_ioport_writel(void *opaque,
void init_ioports(void)
{
- ioport_opaque = malloc(MAX_IOPORTS * sizeof(*ioport_opaque));
+ ioport_opaque = calloc(MAX_IOPORTS, sizeof(*ioport_opaque));
ioport_read_table = malloc(3 * MAX_IOPORTS * sizeof(**ioport_read_table));
ioport_write_table = malloc(3 * MAX_IOPORTS * sizeof(**ioport_write_table));
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ioemu: Initialize ioport_opaque to zero
2008-03-19 17:02 [PATCH] ioemu: Initialize ioport_opaque to zero Samuel Thibault
@ 2008-03-19 17:07 ` Samuel Thibault
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2008-03-19 17:07 UTC (permalink / raw)
To: xen-devel
Samuel Thibault, le Wed 19 Mar 2008 17:02:59 +0000, a écrit :
> ioemu: Initialize ioport_opaque to zero
> since register_ioport_read requires it.
Mmm, actually ioport_read/write_table need it too:
ioemu: Initialize ioport_opaque, ioport_read/write_table to zero
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
diff -r b3c8dcb98543 tools/ioemu/vl.c
--- a/tools/ioemu/vl.c Wed Mar 19 16:25:52 2008 +0000
+++ b/tools/ioemu/vl.c Wed Mar 19 17:05:03 2008 +0000
@@ -281,9 +281,9 @@ void default_ioport_writel(void *opaque,
void init_ioports(void)
{
- ioport_opaque = malloc(MAX_IOPORTS * sizeof(*ioport_opaque));
- ioport_read_table = malloc(3 * MAX_IOPORTS * sizeof(**ioport_read_table));
- ioport_write_table = malloc(3 * MAX_IOPORTS * sizeof(**ioport_write_table));
+ ioport_opaque = calloc(MAX_IOPORTS, sizeof(*ioport_opaque));
+ ioport_read_table = calloc(3 * MAX_IOPORTS, sizeof(**ioport_read_table));
+ ioport_write_table = calloc(3 * MAX_IOPORTS, sizeof(**ioport_write_table));
}
/* size is the word size in byte */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-19 17:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-19 17:02 [PATCH] ioemu: Initialize ioport_opaque to zero Samuel Thibault
2008-03-19 17:07 ` Samuel Thibault
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.