]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
fs/nfs: Fix used uninitialized warn in nfs4_slot_seqid_in_use()
authorShuah Khan <shuahkh@osg.samsung.com>
Mon, 7 Nov 2016 17:48:16 +0000 (10:48 -0700)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Mon, 7 Nov 2016 21:11:30 +0000 (16:11 -0500)
Fix the following warn:

fs/nfs/nfs4session.c: In function ‘nfs4_slot_seqid_in_use’:
fs/nfs/nfs4session.c:203:54: warning: ‘cur_seq’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  if (nfs4_slot_get_seqid(tbl, slotid, &cur_seq) == 0 &&
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      cur_seq == seq_nr && test_bit(slotid, tbl->used_slots))
      ~~~~~~~~~~~~~~~~~

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/nfs4session.c

index 150c5a1879bff92e7c0658f8cb920e94ba457e09..a61350f75c741d734475cfa38903118d673b76aa 100644 (file)
@@ -198,7 +198,7 @@ static int nfs4_slot_get_seqid(struct nfs4_slot_table  *tbl, u32 slotid,
 static bool nfs4_slot_seqid_in_use(struct nfs4_slot_table *tbl,
                u32 slotid, u32 seq_nr)
 {
-       u32 cur_seq;
+       u32 cur_seq = 0;
        bool ret = false;
 
        spin_lock(&tbl->slot_tbl_lock);