[Bug 238167] fs/nfsclient/nfs_clvnops.c: suspicious "if" statement

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue May 28 08:31:15 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238167

--- Comment #1 from Alexey Dokuchaev <danfe at FreeBSD.org> ---
Also, in the same file, there's another warning:

/usr/src/sys/fs/nfsclient/nfs_clvnops.c:1187:1: warning: V519 The 'error'
variable is assigned values twice successively. Perhaps this is a mistake.
Check lines: 1184, 1187:

> 191783   rmacklem       error = 0;
> 191783   rmacklem       newvp = NULLVP;
> 304026   rmacklem       NFSINCRGLOBAL(nfsstatsv1.lookupcache_misses);
> 191783   rmacklem       error = nfsrpc_lookup(dvp, ...);
You might also reconsider needless local variable initialization on line 2496
(it is explicitly assigned three lines below):

> 191783   rmacklem       int error = 0, attrflag, dattrflag;
> 191783   rmacklem       u_int hash;
> 191783   rmacklem
> 191783   rmacklem       error = nfsrpc_lookup(dvp, ...);

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list