qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v4 02/12] fix qemu_alloc/qemu_free for hw subsystem


From: Jean-Christophe DUBOIS
Subject: [Qemu-devel] [PATCH v4 02/12] fix qemu_alloc/qemu_free for hw subsystem
Date: Thu, 18 Jun 2009 22:50:09 +0200

From: Jean-Christophe Dubois <address@hidden(none)>

Signed-off-by: Jean-Christophe DUBOIS <address@hidden>
---
 hw/baum.c         |    8 ++++----
 hw/bt-l2cap.c     |    2 +-
 hw/nseries.c      |    2 +-
 hw/scsi-generic.c |    4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hw/baum.c b/hw/baum.c
index b47ea34..b40ccbe 100644
--- a/hw/baum.c
+++ b/hw/baum.c
@@ -558,7 +558,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);
-        free(baum->brlapi);
+        qemu_free(baum->brlapi);
         baum->brlapi = NULL;
     }
 }
@@ -621,9 +621,9 @@ fail:
     qemu_free_timer(baum->cellCount_timer);
     brlapi__closeConnection(handle);
 fail_handle:
-    free(handle);
-    free(chr);
-    free(baum);
+    qemu_free(handle);
+    qemu_free(chr);
+    qemu_free(baum);
     return NULL;
 }
 
diff --git a/hw/bt-l2cap.c b/hw/bt-l2cap.c
index b22b761..7403972 100644
--- a/hw/bt-l2cap.c
+++ b/hw/bt-l2cap.c
@@ -1220,7 +1220,7 @@ static void l2cap_teardown(struct l2cap_instance_s 
*l2cap, int send_disconnect)
     for (cid = L2CAP_CID_ALLOC; cid < L2CAP_CID_MAX; cid ++)
         if (l2cap->cid[cid]) {
             l2cap->cid[cid]->params.close(l2cap->cid[cid]->params.opaque);
-            free(l2cap->cid[cid]);
+            qemu_free(l2cap->cid[cid]);
         }
 
     if (l2cap->role)
diff --git a/hw/nseries.c b/hw/nseries.c
index b412aa0..80da80a 100644
--- a/hw/nseries.c
+++ b/hw/nseries.c
@@ -711,7 +711,7 @@ static void n800_dss_init(struct rfbi_chip_s *chip)
     fb_blank = memset(qemu_malloc(800 * 480 * 2), 0xff, 800 * 480 * 2);
     /* Display Memory Data Port */
     chip->block(chip->opaque, 1, fb_blank, 800 * 480 * 2, 800);
-    free(fb_blank);
+    qemu_free(fb_blank);
 }
 
 static void n8x0_dss_setup(struct n800_s *s)
diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index c827c04..5983bae 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -564,7 +564,7 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t 
tag,
 
     if (len == 0) {
         if (r->buf != NULL)
-            free(r->buf);
+            qemu_free(r->buf);
         r->buflen = 0;
         r->buf = NULL;
         ret = execute_command(s->bdrv, r, SG_DXFER_NONE, 
scsi_command_complete);
@@ -577,7 +577,7 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t 
tag,
 
     if (r->buflen != len) {
         if (r->buf != NULL)
-            free(r->buf);
+            qemu_free(r->buf);
         r->buf = qemu_malloc(len);
         r->buflen = len;
     }
-- 
1.6.0.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]