Skip to contentSkip to conversation

fs/fuse/file.c:387 fuse_file_release() error: we previously assumed 'ra' could be null (see line 373)

PATCH New Dan Carpenter 1 participant 1 message Feb 16, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/fuse/file.c:387 fuse_file_release() error: we previously assumed 'ra' could be null (see line 373)

tree:   https://android.googlesource.com/kernel/common android16-6.12-desktop
head:   0f556311bc475a36a147f111a9c5f0769a655730
commit: 8be90ef631b70dedc3c43b247aeae296a633dcb2 [1/1] ANDROID: fuse-bpf: fuse-bpf v1.2
config: i386-randconfig-141-20250216 (https://download.01.org/0day-ci/archive/20250216/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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 <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

smatch warnings:
fs/fuse/file.c:387 fuse_file_release() error: we previously assumed 'ra' could be null (see line 373)

vim +/ra +387 fs/fuse/file.c

b9d54c6f29d9dc Miklos Szeredi   2021-04-07  364  void fuse_file_release(struct inode *inode, struct fuse_file *ff,
b9d54c6f29d9dc Miklos Szeredi   2021-04-07  365  		       unsigned int open_flags, fl_owner_t id, bool isdir)
fd72faac95d7e4 Miklos Szeredi   2005-11-07  366  {
b9d54c6f29d9dc Miklos Szeredi   2021-04-07  367  	struct fuse_inode *fi = get_fuse_inode(inode);
fc8ff397b2a915 Amir Goldstein   2024-02-09  368  	struct fuse_release_args *ra = &ff->args->release_args;
2e64ff154ce6ce Chad Austin      2018-12-10  369  	int opcode = isdir ? FUSE_RELEASEDIR : FUSE_RELEASE;
6b2db28a7a2da1 Tejun Heo        2009-04-14  370  
e26ee4efbc7961 Amir Goldstein   2024-02-01  371  	fuse_prepare_release(fi, ff, open_flags, opcode, false);
51eb01e73599ef Miklos Szeredi   2006-06-25  372  
e26ee4efbc7961 Amir Goldstein   2024-02-01 @373  	if (ra && ff->flock) {

Ths "ra" check is not required.

	if (ff->flock) {
4cb548666e4c13 Miklos Szeredi   2019-09-10  374  		ra->inarg.release_flags |= FUSE_RELEASE_FLOCK_UNLOCK;
b9d54c6f29d9dc Miklos Szeredi   2021-04-07  375  		ra->inarg.lock_owner = fuse_lock_owner_id(ff->fm->fc, id);
37fb3a30b46237 Miklos Szeredi   2011-08-08  376  	}
93a8c3cd9e9834 Miklos Szeredi   2007-10-18  377  
c756e0a4d79202 Miklos Szeredi   2007-10-16  378  	/*
6b2db28a7a2da1 Tejun Heo        2009-04-14  379  	 * Normally this will send the RELEASE request, however if
6b2db28a7a2da1 Tejun Heo        2009-04-14  380  	 * some asynchronous READ or WRITE requests are outstanding,
6b2db28a7a2da1 Tejun Heo        2009-04-14  381  	 * the sending will be delayed.
5a18ec176c934c Miklos Szeredi   2011-02-25  382  	 *
5a18ec176c934c Miklos Szeredi   2011-02-25  383  	 * Make the release synchronous if this is a fuseblk mount,
5a18ec176c934c Miklos Szeredi   2011-02-25  384  	 * synchronous RELEASE is allowed (and desirable) in this case
5a18ec176c934c Miklos Szeredi   2011-02-25  385  	 * because the server can be trusted not to screw up.
c756e0a4d79202 Miklos Szeredi   2007-10-16  386  	 */

8be90ef631b70d Daniel Rosenberg 2021-12-02 @387 fuse_file_put(ra->inode, ff, ff->fm->fc->destroy);
b6aeadeda22a9a Miklos Szeredi 2005-09-09 388 }

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