Patchwork [PATCH-V2,23/24] virtio-9p: Fix the memset usage

login
register
mail settings
Submitter jvrao
Date July 21, 2010, 4:04 p.m.
Message ID <1279728299-28482-24-git-send-email-jvrao@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/59461/
State New
Headers show

Comments

jvrao - July 21, 2010, 4:04 p.m.
From: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

The arguments are wrong. Use qemu_mallocz directly

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
---
 hw/virtio-9p.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/virtio-9p.c b/hw/virtio-9p.c
index 68103ab..1621dab 100644
--- a/hw/virtio-9p.c
+++ b/hw/virtio-9p.c
@@ -2824,8 +2824,7 @@  static void v9fs_wstat_post_chown(V9fsState *s, V9fsWstatState *vs, int err)
     if (vs->v9stat.name.size != 0) {
 	V9fsRenameState *vr;
 
-	vr = qemu_malloc(sizeof(V9fsRenameState));
-	memset(vr, sizeof(*vr), 0);
+        vr = qemu_mallocz(sizeof(V9fsRenameState));
 	vr->newdirfid = -1;
 	vr->pdu = vs->pdu;
 	vr->fidp = vs->fidp;