Hello -

Clang reports a possible user of an uninitalized variable in
nfs_vnops.c line 2605.

attrflag is uninitialized when calling nfsm_postop_attr(), which is a
macro that only sets attrflag if (info.nmi_mrep != NULL).  I am not sure
if that is possible, but maybe a KASSERT(info.nmi_mrep != NULL) before
nfsm_postop_attr() would catch a bug...

Or just silence it with:

Index: nfs_vnops.c
===================================================================
RCS file: /cvs/src/sys/nfs/nfs_vnops.c,v
retrieving revision 1.169
diff -u -p -r1.169 nfs_vnops.c
--- nfs_vnops.c 29 Apr 2016 14:40:36 -0000      1.169
+++ nfs_vnops.c 6 Jun 2016 17:34:24 -0000
@@ -2562,7 +2562,7 @@ nfs_lookitup(struct vnode *dvp, char *na
        struct vnode *newvp = NULL;
        struct nfsnode *np, *dnp = VTONFS(dvp);
        caddr_t cp2;
-       int error = 0, fhlen, attrflag;
+       int error = 0, fhlen, attrflag = 0;
        nfsfh_t *nfhp;
 
        info.nmi_v3 = NFS_ISV3(dvp);

Reply via email to