All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [amir73il:fuse-backing-fd 9/13] fs/fuse/passthrough.c:70:6: warning: variable 'fb' is used uninitialized whenever 'if' condition is false
Date: Fri, 8 Sep 2023 20:37:36 +0800	[thread overview]
Message-ID: <202309082011.xa56ORo3-lkp@intel.com> (raw)

tree:   https://github.com/amir73il/linux fuse-backing-fd
head:   d49ddc74f18aec5fb799e68b710df0f60928b2f5
commit: f89ded39822038bda45a92145fca90f6293767bb [9/13] fuse: implement ioctls to setup inode bound backing files
config: riscv-randconfig-r023-20230908 (https://download.01.org/0day-ci/archive/20230908/202309082011.xa56ORo3-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230908/202309082011.xa56ORo3-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309082011.xa56ORo3-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/fuse/passthrough.c:70:6: warning: variable 'fb' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      70 |         if (inode) {
         |             ^~~~~
   fs/fuse/passthrough.c:81:9: note: uninitialized use occurs here
      81 |         return fb ?: ERR_PTR(err);
         |                ^~
   fs/fuse/passthrough.c:70:2: note: remove the 'if' if its condition is always true
      70 |         if (inode) {
         |         ^~~~~~~~~~~
   fs/fuse/passthrough.c:63:25: note: initialize the variable 'fb' to silence this warning
      63 |         struct fuse_backing *fb;
         |                                ^
         |                                 = NULL
   1 warning generated.


vim +70 fs/fuse/passthrough.c

    58	
    59	/* Detach the inode bound backing file from inode */
    60	static struct fuse_backing *fuse_backing_detach(struct fuse_conn *fc,
    61							u64 nodeid)
    62	{
    63		struct fuse_backing *fb;
    64		struct inode *inode;
    65		int err = -ENODEV;
    66	
    67		down_read(&fc->killsb);
    68	
    69		inode = fuse_ilookup(fc, nodeid, NULL);
  > 70		if (inode) {
    71			struct fuse_inode *fi = get_fuse_inode(inode);
    72	
    73			fb = xchg(&fi->fb, NULL);
    74			iput(inode);
    75			if (!fb)
    76				err = -ENOENT;
    77		}
    78	
    79		up_read(&fc->killsb);
    80	
    81		return fb ?: ERR_PTR(err);
    82	}
    83	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2023-09-08 12:38 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=202309082011.xa56ORo3-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=amir73il@gmail.com \
    --cc=oe-kbuild-all@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.