vol: Call memset with the correct size
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 30 Mar 2012 18:31:10 +0000 (19:31 +0100)
committerDerrick Brashear <shadow@dementix.org>
Mon, 9 Apr 2012 01:14:56 +0000 (18:14 -0700)
Call memset with the size of the structure we're initialising to 0,
and not the size of the pointer to that structure.

Caught by clang's new warnings.

Change-Id: I8cded7bed4e289e9603778e06873f94fd3924aa8
Reviewed-on: http://gerrit.openafs.org/7083
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/vol/vol-salvage.c

index 390c202..0b1fa26 100644 (file)
@@ -3323,7 +3323,7 @@ DistilVnodeEssence(struct SalvInfo *salvinfo, VolumeId rwVId,
                if (class != vLarge) {
                    VnodeId vnodeNumber = bitNumberToVnodeNumber(vnodeIndex, class);
                    vip->nAllocatedVnodes--;
-                   memset(vnode, 0, sizeof(vnode));
+                   memset(vnode, 0, sizeof(*vnode));
                    IH_IWRITE(salvinfo->vnodeInfo[vSmall].handle,
                              vnodeIndexOffset(vcp, vnodeNumber),
                              (char *)&vnode, sizeof(vnode));