[linux-next:master 8227/9575] fs/libfs.c:2018:13: sparse: sparse: Using plain integer as NULL pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   33e1d31873f87d119e5120b88cd350efa68ef276
commit: 6cac4ea940896aa83f82e01fa22965f51a6158bc [8227/9575] libfs: add path_from_stashed()
config: hexagon-randconfig-r113-20240226 (https://download.01.org/0day-ci/archive/20240226/202402261334.nvl11hSF-lkp@xxxxxxxxx/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project edd4aee4dd9b5b98b2576a6f783e4086173d902a)
reproduce: (https://download.01.org/0day-ci/archive/20240226/202402261334.nvl11hSF-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402261334.nvl11hSF-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> fs/libfs.c:2018:13: sparse: sparse: Using plain integer as NULL pointer
   fs/libfs.c:2049:5: sparse: sparse: context imbalance in 'path_from_stashed' - wrong count at exit

vim +2018 fs/libfs.c

  1989	
  1990	static struct dentry *stash_dentry(struct dentry **stashed, unsigned long ino,
  1991					   struct super_block *sb,
  1992					   const struct file_operations *fops,
  1993					   void *data)
  1994	{
  1995		struct dentry *dentry;
  1996		struct inode *inode;
  1997	
  1998		dentry = d_alloc_anon(sb);
  1999		if (!dentry)
  2000			return ERR_PTR(-ENOMEM);
  2001	
  2002		inode = new_inode_pseudo(sb);
  2003		if (!inode) {
  2004			dput(dentry);
  2005			return ERR_PTR(-ENOMEM);
  2006		}
  2007	
  2008		inode->i_ino = ino;
  2009		inode->i_flags |= S_IMMUTABLE;
  2010		inode->i_mode = S_IFREG | S_IRUGO;
  2011		inode->i_fop = fops;
  2012		inode->i_private = data;
  2013		simple_inode_init_ts(inode);
  2014	
  2015		/* @data is now owned by the fs */
  2016		d_instantiate(dentry, inode);
  2017	
> 2018		if (cmpxchg(stashed, NULL, dentry)) {
  2019			d_delete(dentry); /* make sure ->d_prune() does nothing */
  2020			dput(dentry);
  2021			cpu_relax();
  2022			return ERR_PTR(-EAGAIN);
  2023		}
  2024	
  2025		return dentry;
  2026	}
  2027	

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux