Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932835AbcKGRsY (ORCPT ); Mon, 7 Nov 2016 12:48:24 -0500 Received: from resqmta-po-07v.sys.comcast.net ([96.114.154.166]:41025 "EHLO resqmta-po-07v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932464AbcKGRsX (ORCPT ); Mon, 7 Nov 2016 12:48:23 -0500 From: Shuah Khan To: trond.myklebust@primarydata.com, anna.schumaker@netapp.com Cc: Shuah Khan , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fs/nfs: Fix used uninitialized warn in nfs4_slot_seqid_in_use() Date: Mon, 7 Nov 2016 10:48:16 -0700 Message-Id: <20161107174816.22587-1-shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfD71+s/Z3V+n+rZijthOjFn+LdHLkVZwzqeM2WEYjCyRS+9LcWhA4K5VT/zHalajnwg0xMK4wu5GAuUGHTqg/328ixfAz4RLTpG6vIYNQgrb1Dly+aNr iFgWhgb8JwuDsMDH1ZCt4x2fEzsGumjRYjrTbM7PYRHI49QyMRrB53fqIuNON9oFx6qY+0mXsh9Eec1PGQMQgFNvdEChdKjcX5XLQIjTxvKDFBozKifTU0L/ dxtg5Cj/rtMDYszaoeXKqW/SbhrBWy/YbzwPOfakka1HYzDZxyCW0hZIKJUW21CSLx5MtzeyUyRVzbRH7YkBC+m1ozyR5J00sVerozqzi2MonpPFSSHyNnP5 gm9Pg5+L Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 972 Lines: 30 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 --- fs/nfs/nfs4session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c index b629730..68e700e 100644 --- a/fs/nfs/nfs4session.c +++ b/fs/nfs/nfs4session.c @@ -196,7 +196,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); -- 2.9.3