Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Zach Brown <zab@zabbo.net>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [zab-rpdfs:rpdfs-initial 39/71] fs/rpdfs/dir.c:188:6: warning: variable 'inode' is used uninitialized whenever 'if' condition is true
Date: Fri, 24 Apr 2026 19:51:05 +0800	[thread overview]
Message-ID: <202604241900.EP5N8dLy-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-04-24 11:52 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=202604241900.EP5N8dLy-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=zab@zabbo.net \
    /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