virtio-9p: Fix the memset usage
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Thu, 2 Sep 2010 05:39:07 +0000 (11:09 +0530)
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Wed, 8 Sep 2010 17:26:42 +0000 (22:56 +0530)
The arguments are wrong. Use qemu_mallocz directly

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/virtio-9p.c

index 4127439cf08774edda3240069ff062036b4a5ca0..a53b2225e629732435214ca987a2c0743cbf7f7f 100644 (file)
@@ -2823,8 +2823,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;