linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Christian Brauner <brauner@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Jeff Layton <jlayton@kernel.org>
Subject: [linux-next:master 4148/4951] fs/fcntl.c:111:13: sparse: sparse: Using plain integer as NULL pointer
Date: Thu, 15 Aug 2024 21:11:55 +0800	[thread overview]
Message-ID: <202408152155.21zGGsA0-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   edd1ec2e3a9f5de7fb267a3af73e4f00e7e052b7
commit: 0e8540d012189259261c75360d2725a2107761e7 [4148/4951] file: reclaim 24 bytes from f_owner
config: hexagon-randconfig-r123-20240814 (https://download.01.org/0day-ci/archive/20240815/202408152155.21zGGsA0-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project f86594788ce93b696675c94f54016d27a6c21d18)
reproduce: (https://download.01.org/0day-ci/archive/20240815/202408152155.21zGGsA0-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/202408152155.21zGGsA0-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> fs/fcntl.c:111:13: sparse: sparse: Using plain integer as NULL pointer
   fs/fcntl.c:488:47: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected struct flock [noderef] __user *user @@     got struct flock * @@
   fs/fcntl.c:488:47: sparse:     expected struct flock [noderef] __user *user
   fs/fcntl.c:488:47: sparse:     got struct flock *
   fs/fcntl.c:502:51: sparse: sparse: incorrect type in argument 4 (different address spaces) @@     expected struct flock [noderef] __user *user @@     got struct flock * @@
   fs/fcntl.c:502:51: sparse:     expected struct flock [noderef] __user *user
   fs/fcntl.c:502:51: sparse:     got struct flock *
   fs/fcntl.c:1068:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
   fs/fcntl.c:1068:9: sparse:    struct fasync_struct [noderef] __rcu *
   fs/fcntl.c:1068:9: sparse:    struct fasync_struct *
   fs/fcntl.c:1146:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
   fs/fcntl.c:1146:22: sparse:    struct fasync_struct [noderef] __rcu *
   fs/fcntl.c:1146:22: sparse:    struct fasync_struct *
   fs/fcntl.c:1157:33: sparse: sparse: incompatible types in comparison expression (different address spaces):
   fs/fcntl.c:1157:33: sparse:    struct fasync_struct [noderef] __rcu *
   fs/fcntl.c:1157:33: sparse:    struct fasync_struct *
   fs/fcntl.c:306:9: sparse: sparse: context imbalance in 'f_getown_ex' - different lock contexts for basic block

vim +111 fs/fcntl.c

    91	
    92	/*
    93	 * Allocate an file->f_owner struct if it doesn't exist, handling racing
    94	 * allocations correctly.
    95	 */
    96	int file_f_owner_allocate(struct file *file)
    97	{
    98		struct fown_struct *f_owner;
    99	
   100		f_owner = file_f_owner(file);
   101		if (f_owner)
   102			return 0;
   103	
   104		f_owner = kzalloc(sizeof(struct fown_struct), GFP_KERNEL);
   105		if (!f_owner)
   106			return -ENOMEM;
   107	
   108		rwlock_init(&f_owner->lock);
   109		f_owner->file = file;
   110		/* If someone else raced us, drop our allocation. */
 > 111		if (unlikely(cmpxchg(&file->f_owner, NULL, f_owner)))
   112			kfree(f_owner);
   113		return 0;
   114	}
   115	EXPORT_SYMBOL(file_f_owner_allocate);
   116	

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


                 reply	other threads:[~2024-08-15 13:15 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=202408152155.21zGGsA0-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=brauner@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=linux-mm@kvack.org \
    --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