summaryrefslogtreecommitdiffstats
path: root/hw/input/ps2.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/input/ps2.c')
-rw-r--r--hw/input/ps2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 6236711e1b..c16df1de7a 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -1226,7 +1226,7 @@ static QemuInputHandler ps2_keyboard_handler = {
void *ps2_kbd_init(void (*update_irq)(void *, int), void *update_arg)
{
- PS2KbdState *s = (PS2KbdState *)g_malloc0(sizeof(PS2KbdState));
+ PS2KbdState *s = g_new0(PS2KbdState, 1);
trace_ps2_kbd_init(s);
s->common.update_irq = update_irq;
@@ -1248,7 +1248,7 @@ static QemuInputHandler ps2_mouse_handler = {
void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg)
{
- PS2MouseState *s = (PS2MouseState *)g_malloc0(sizeof(PS2MouseState));
+ PS2MouseState *s = g_new0(PS2MouseState, 1);
trace_ps2_mouse_init(s);
s->common.update_irq = update_irq;