All of lore.kernel.org
 help / color / mirror / Atom feed
* [amir73il:fuse-backing-fd 9/13] fs/fuse/passthrough.c:70:6: warning: variable 'fb' is used uninitialized whenever 'if' condition is false
@ 2023-09-08 12:37 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-09-08 12:37 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: oe-kbuild-all

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-08 12:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-08 12:37 [amir73il:fuse-backing-fd 9/13] fs/fuse/passthrough.c:70:6: warning: variable 'fb' is used uninitialized whenever 'if' condition is false kernel test robot

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.