Patchwork [6/8] Fix qemu_free use in scsi-generic.c

login
register
mail settings
Submitter Jean-Christophe DUBOIS
Date Nov. 15, 2009, 6:18 p.m.
Message ID <1258309100-29591-6-git-send-email-jcd@tribudubois.net>
Download mbox | patch
Permalink /patch/38468/
State New
Headers show

Comments

Jean-Christophe DUBOIS - Nov. 15, 2009, 6:18 p.m.
scsi-generic.c is using free() instead of qemu_free().
Fix it.

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>
---
 hw/scsi-generic.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index 92ef771..cf56ea0 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -561,7 +561,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->dinfo->bdrv, r, SG_DXFER_NONE, scsi_command_complete);
@@ -574,7 +574,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;
     }