Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [zab-rpdfs:rpdfs-initial 39/71] fs/rpdfs/dir.c:188:6: warning: variable 'inode' is used uninitialized whenever 'if' condition is true
@ 2026-04-24 11:51 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-04-24 11:51 UTC (permalink / raw)
  To: Zach Brown; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/zab/linux-rpdfs.git rpdfs-initial
head:   4c70e08d984665a04c3879b17ee74470846a3b47
commit: babd2186d11672777dfa3e80a446f081227ddf7f [39/71] rpdfs: access dirents with block handles
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20260424/202604241900.EP5N8dLy-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260424/202604241900.EP5N8dLy-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/202604241900.EP5N8dLy-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/rpdfs/dir.c:188:6: warning: variable 'inode' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     188 |         if (ret < 0)
         |             ^~~~~~~
   fs/rpdfs/dir.c:205:24: note: uninitialized use occurs here
     205 |         return d_splice_alias(inode, dentry);
         |                               ^~~~~
   fs/rpdfs/dir.c:188:2: note: remove the 'if' if its condition is always false
     188 |         if (ret < 0)
         |         ^~~~~~~~~~~~
     189 |                 goto out;
         |                 ~~~~~~~~
   fs/rpdfs/dir.c:177:21: note: initialize the variable 'inode' to silence this warning
     177 |         struct inode *inode;
         |                            ^
         |                             = NULL
   1 warning generated.


vim +188 fs/rpdfs/dir.c

   170	
   171	static struct dentry *rpdfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
   172	{
   173		struct super_block *sb = dir->i_sb;
   174		struct rpdfs_fs_info *rfi = RPDFS_INODE_FS(dir);
   175		struct rpdfs_block_handle *hnd = NULL;
   176		struct dent_cb_args da;
   177		struct inode *inode;
   178		int ret;
   179	
   180		if (dentry->d_name.len > RPDFS_NAME_MAX) {
   181			inode = ERR_PTR(-ENAMETOOLONG);
   182			goto out;
   183		}
   184	
   185		init_dent_cb_args(&da, dentry, NULL);
   186	
   187		ret = rpdfs_inode_acquire(rfi, dir, &hnd, 0);
 > 188		if (ret < 0)
   189			goto out;
   190	
   191		ret = lookup_entry(rfi, dir, &da);
   192		rpdfs_block_release(rfi, &hnd);
   193		if (ret < 0 && ret != -ENOENT) {
   194			inode = ERR_PTR(ret);
   195			goto out;
   196		}
   197	
   198		if (ret == -ENOENT)
   199			inode = NULL;
   200		else
   201			inode = rpdfs_iget(sb, &da.dent.ig);
   202	
   203	out:
   204		/* d_splice_alias passes through ERR_PTR inodes */
   205		return d_splice_alias(inode, dentry);
   206	}
   207	

-- 
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:[~2026-04-24 11:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-24 11:51 [zab-rpdfs:rpdfs-initial 39/71] fs/rpdfs/dir.c:188:6: warning: variable 'inode' is used uninitialized whenever 'if' condition is true kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox