]> git.baikalelectronics.ru Git - kernel.git/commit
NFSv4.1: work around -Wmaybe-uninitialized warning
authorArnd Bergmann <arnd@arndb.de>
Thu, 10 Nov 2016 16:44:45 +0000 (17:44 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 11 Nov 2016 16:45:08 +0000 (08:45 -0800)
commitd1a4de0c04adc56ea5396680fa787980a6cc93cc
tree2a401d9abe634b6931e2903ad694a9f20131adde
parentd638cd3e61dec9dd8ed6ca3b975ace22d5bf8cf2
NFSv4.1: work around -Wmaybe-uninitialized warning

A bugfix introduced a harmless gcc warning in nfs4_slot_seqid_in_use if
we enable -Wmaybe-uninitialized again:

  fs/nfs/nfs4session.c:203:54: error: 'cur_seq' may be used uninitialized in this function [-Werror=maybe-uninitialized]

gcc is not smart enough to conclude that the IS_ERR/PTR_ERR pair results
in a nonzero return value here.  Using PTR_ERR_OR_ZERO() instead makes
this clear to the compiler.

Fixes: 0cb51cfb8b28 ("NFSv4.1: Fix Oopsable condition in server callback races")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/nfs/nfs4session.c