public inbox for llvm@lists.linux.dev
 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>
Subject: [brauner-vfs:work.f_owner 1/1] drivers/net/tun.c:3509:12: error: invalid operands to binary expression ('struct tun_file *' and 'struct sock')
Date: Mon, 12 Aug 2024 22:04:21 +0800	[thread overview]
Message-ID: <202408122247.pYJJ8C5g-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git work.f_owner
head:   06c2bce128dd5099bfb11734c6c043e38b8f40df
commit: 06c2bce128dd5099bfb11734c6c043e38b8f40df [1/1] file: reclaim 24 bytes from f_owner
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20240812/202408122247.pYJJ8C5g-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240812/202408122247.pYJJ8C5g-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/202408122247.pYJJ8C5g-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/net/tun.c:3509:12: error: invalid operands to binary expression ('struct tun_file *' and 'struct sock')
    3509 |         if (tfile && tfile->sk)
         |             ~~~~~ ^  ~~~~~~~~~
   1 error generated.


vim +3509 drivers/net/tun.c

  3466	
  3467	static int tun_chr_open(struct inode *inode, struct file * file)
  3468	{
  3469		struct net *net = current->nsproxy->net_ns;
  3470		struct tun_file *tfile;
  3471		int ret;
  3472	
  3473		ret = file_f_owner_allocate(file);
  3474		if (ret)
  3475			return ret;
  3476	
  3477		tfile = (struct tun_file *)sk_alloc(net, AF_UNSPEC, GFP_KERNEL,
  3478						    &tun_proto, 0);
  3479		if (!tfile)
  3480			goto out_cleanup;
  3481		if (ptr_ring_init(&tfile->tx_ring, 0, GFP_KERNEL))
  3482			goto out_cleanup;
  3483	
  3484		mutex_init(&tfile->napi_mutex);
  3485		RCU_INIT_POINTER(tfile->tun, NULL);
  3486		tfile->flags = 0;
  3487		tfile->ifindex = 0;
  3488	
  3489		init_waitqueue_head(&tfile->socket.wq.wait);
  3490	
  3491		tfile->socket.file = file;
  3492		tfile->socket.ops = &tun_socket_ops;
  3493	
  3494		sock_init_data_uid(&tfile->socket, &tfile->sk, current_fsuid());
  3495	
  3496		tfile->sk.sk_write_space = tun_sock_write_space;
  3497		tfile->sk.sk_sndbuf = INT_MAX;
  3498	
  3499		file->private_data = tfile;
  3500		INIT_LIST_HEAD(&tfile->next);
  3501	
  3502		sock_set_flag(&tfile->sk, SOCK_ZEROCOPY);
  3503	
  3504		/* tun groks IOCB_NOWAIT just fine, mark it as such */
  3505		file->f_mode |= FMODE_NOWAIT;
  3506		return 0;
  3507	
  3508	out_cleanup:
> 3509		if (tfile && tfile->sk)
  3510			sk_free(&tfile->sk);
  3511		kfree(file->f_owner);
  3512		return -ENOMEM;
  3513	}
  3514	

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

                 reply	other threads:[~2024-08-12 14:05 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=202408122247.pYJJ8C5g-lkp@intel.com \
    --to=lkp@intel.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