mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Howells <dhowells@redhat.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	GNU/Weeb Mailing List <gwml@gnuweeb.org>,
	linux-kernel@vger.kernel.org
Subject: [ammarfaizi2-block:dhowells/linux-fs/netfs-lib 14/24] fs/netfs/read_helper.c:979:14: warning: variable 'folio' is uninitialized when used here
Date: Tue, 18 Jan 2022 05:48:20 +0800	[thread overview]
Message-ID: <202201180514.gVYTloyy-lkp@intel.com> (raw)

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/netfs-lib
head:   e450b62f32df4384c141a6a382811b3fe5723bad
commit: e6b340ed3634bb80396afb564c499eebdeff601f [14/24] netfs: Use a buffer in netfs_read_request and add pages to it
config: x86_64-randconfig-a001-20220117 (https://download.01.org/0day-ci/archive/20220118/202201180514.gVYTloyy-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5f782d25a742302d25ef3c8b84b54f7483c2deb9)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/ammarfaizi2/linux-block/commit/e6b340ed3634bb80396afb564c499eebdeff601f
        git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
        git fetch --no-tags ammarfaizi2-block dhowells/linux-fs/netfs-lib
        git checkout e6b340ed3634bb80396afb564c499eebdeff601f
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash fs/netfs/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> fs/netfs/read_helper.c:979:14: warning: variable 'folio' is uninitialized when used here [-Wuninitialized]
                           folio_put(folio);
                                     ^~~~~
   fs/netfs/read_helper.c:928:21: note: initialize the variable 'folio' to silence this warning
           struct folio *folio;
                              ^
                               = NULL
   1 warning generated.


vim +/folio +979 fs/netfs/read_helper.c

   943	
   944		ret = netfs_rreq_add_folios_to_buffer(rreq, want_index, have_index - 1,
   945						      gfp_mask);
   946		if (ret < 0)
   947			return ret;
   948		have_folios += have_index - want_index;
   949	
   950		ret = netfs_rreq_add_folios_to_buffer(rreq, have_index + have_folios,
   951						      want_index + want_folios - 1,
   952						      gfp_mask);
   953		if (ret < 0)
   954			return ret;
   955	
   956		/* Transfer the folios proposed by the VM into the buffer and take refs
   957		 * on them.  The locks will be dropped in netfs_rreq_unlock().
   958		 */
   959		if (ractl) {
   960			while ((folio = readahead_folio(ractl))) {
   961				folio_get(folio);
   962				if (folio == keep)
   963					folio_get(folio);
   964				ret = xa_insert_set_mark(&rreq->buffer,
   965							 folio_index(folio), folio,
   966							 XA_MARK_0, gfp_mask);
   967				if (ret < 0) {
   968					if (folio != keep)
   969						folio_unlock(folio);
   970					folio_put(folio);
   971					return ret;
   972				}
   973			}
   974		} else {
   975			folio_get(keep);
   976			ret = xa_insert_set_mark(&rreq->buffer, keep->index, keep,
   977						 XA_MARK_0, gfp_mask);
   978			if (ret < 0) {
 > 979				folio_put(folio);
   980				return ret;
   981			}
   982		}
   983		return 0;
   984	}
   985	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

                 reply	other threads:[~2022-01-17 21:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202201180514.gVYTloyy-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dhowells@redhat.com \
    --cc=gwml@gnuweeb.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®