Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Christian Brauner <brauner@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Christian Brauner <christianvanbrauner@gmail.com>,
	Amir Goldstein <amir73il@gmail.com>
Subject: [brauner-github:kernel-6.19.cred 12/39] fs/backing-file.c:209:9: warning: variable 'ret' is uninitialized when used here
Date: Tue, 4 Nov 2025 17:43:41 +0800	[thread overview]
Message-ID: <202511041731.OPKyrqmX-lkp@intel.com> (raw)

tree:   https://github.com/brauner/linux.git kernel-6.19.cred
head:   59e578cf86c391d6595e005247ebefd4f371242c
commit: b9455f57e32048146ad5b98fb477b96eba6e8ffd [12/39] backing-file: use credential guards for reads
config: hexagon-randconfig-002-20251104 (https://download.01.org/0day-ci/archive/20251104/202511041731.OPKyrqmX-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/202511041731.OPKyrqmX-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/202511041731.OPKyrqmX-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/backing-file.c:209:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
           return ret;
                  ^~~
   fs/backing-file.c:191:13: note: initialize the variable 'ret' to silence this warning
           ssize_t ret;
                      ^
                       = 0
   1 warning generated.


vim +/ret +209 fs/backing-file.c

b9455f57e320481 Christian Brauner 2025-11-03  186  
b9455f57e320481 Christian Brauner 2025-11-03  187  ssize_t backing_file_read_iter(struct file *file, struct iov_iter *iter,
b9455f57e320481 Christian Brauner 2025-11-03  188  			       struct kiocb *iocb, int flags,
b9455f57e320481 Christian Brauner 2025-11-03  189  			       struct backing_file_ctx *ctx)
b9455f57e320481 Christian Brauner 2025-11-03  190  {
b9455f57e320481 Christian Brauner 2025-11-03  191  	ssize_t ret;
b9455f57e320481 Christian Brauner 2025-11-03  192  
b9455f57e320481 Christian Brauner 2025-11-03  193  	if (WARN_ON_ONCE(!(file->f_mode & FMODE_BACKING)))
b9455f57e320481 Christian Brauner 2025-11-03  194  		return -EIO;
b9455f57e320481 Christian Brauner 2025-11-03  195  
b9455f57e320481 Christian Brauner 2025-11-03  196  	if (!iov_iter_count(iter))
b9455f57e320481 Christian Brauner 2025-11-03  197  		return 0;
b9455f57e320481 Christian Brauner 2025-11-03  198  
b9455f57e320481 Christian Brauner 2025-11-03  199  	if (iocb->ki_flags & IOCB_DIRECT &&
b9455f57e320481 Christian Brauner 2025-11-03  200  	    !(file->f_mode & FMODE_CAN_ODIRECT))
b9455f57e320481 Christian Brauner 2025-11-03  201  		return -EINVAL;
b9455f57e320481 Christian Brauner 2025-11-03  202  
b9455f57e320481 Christian Brauner 2025-11-03  203  	scoped_with_creds(ctx->cred)
b9455f57e320481 Christian Brauner 2025-11-03  204  		do_backing_file_read_iter(file, iter, iocb, flags);
a6293b3e285cd0d Amir Goldstein    2023-11-22  205  
a6293b3e285cd0d Amir Goldstein    2023-11-22  206  	if (ctx->accessed)
48b50624aec454c Miklos Szeredi    2024-10-21  207  		ctx->accessed(iocb->ki_filp);
a6293b3e285cd0d Amir Goldstein    2023-11-22  208  
a6293b3e285cd0d Amir Goldstein    2023-11-22 @209  	return ret;
a6293b3e285cd0d Amir Goldstein    2023-11-22  210  }
a6293b3e285cd0d Amir Goldstein    2023-11-22  211  EXPORT_SYMBOL_GPL(backing_file_read_iter);
a6293b3e285cd0d Amir Goldstein    2023-11-22  212  

:::::: The code at line 209 was first introduced by commit
:::::: a6293b3e285cd0d7692141d7981a5f144f0e2f0b fs: factor out backing_file_{read,write}_iter() helpers

:::::: TO: Amir Goldstein <amir73il@gmail.com>
:::::: CC: Amir Goldstein <amir73il@gmail.com>

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

                 reply	other threads:[~2025-11-04  9:44 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=202511041731.OPKyrqmX-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=christianvanbrauner@gmail.com \
    --cc=llvm@lists.linux.dev \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox