summaryrefslogtreecommitdiff
path: root/hw/baum.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-20 22:09:37 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-20 23:01:08 -0500
commit7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch)
tree9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /hw/baum.c
parent14015304b662e8f8ccce46c5a6927af6a14c510b (diff)
downloadqemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.gz
qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.bz2
qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.zip
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/baum.c')
-rw-r--r--hw/baum.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/hw/baum.c b/hw/baum.c
index 33a22a73d9..26beeaf7e6 100644
--- a/hw/baum.c
+++ b/hw/baum.c
@@ -559,7 +559,7 @@ static void baum_chr_read(void *opaque)
if (ret == -1 && (brlapi_errno != BRLAPI_ERROR_LIBCERR || errno != EINTR)) {
brlapi_perror("baum: brlapi_readKey");
brlapi__closeConnection(baum->brlapi);
- qemu_free(baum->brlapi);
+ g_free(baum->brlapi);
baum->brlapi = NULL;
}
}
@@ -571,9 +571,9 @@ static void baum_close(struct CharDriverState *chr)
qemu_free_timer(baum->cellCount_timer);
if (baum->brlapi) {
brlapi__closeConnection(baum->brlapi);
- qemu_free(baum->brlapi);
+ g_free(baum->brlapi);
}
- qemu_free(baum);
+ g_free(baum);
}
int chr_baum_init(QemuOpts *opts, CharDriverState **_chr)
@@ -586,8 +586,8 @@ int chr_baum_init(QemuOpts *opts, CharDriverState **_chr)
#endif
int tty;
- baum = qemu_mallocz(sizeof(BaumDriverState));
- baum->chr = chr = qemu_mallocz(sizeof(CharDriverState));
+ baum = g_malloc0(sizeof(BaumDriverState));
+ baum->chr = chr = g_malloc0(sizeof(CharDriverState));
chr->opaque = baum;
chr->chr_write = baum_write;
@@ -595,7 +595,7 @@ int chr_baum_init(QemuOpts *opts, CharDriverState **_chr)
chr->chr_accept_input = baum_accept_input;
chr->chr_close = baum_close;
- handle = qemu_mallocz(brlapi_getHandleSize());
+ handle = g_malloc0(brlapi_getHandleSize());
baum->brlapi = handle;
baum->brlapi_fd = brlapi__openConnection(handle, NULL, NULL);
@@ -636,8 +636,8 @@ fail:
qemu_free_timer(baum->cellCount_timer);
brlapi__closeConnection(handle);
fail_handle:
- qemu_free(handle);
- qemu_free(chr);
- qemu_free(baum);
+ g_free(handle);
+ g_free(chr);
+ g_free(baum);
return -EIO;
}