mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <yujie.liu@intel.com>
To: Usama Arif <usama.arif@bytedance.com>
Cc: <kbuild-all@lists.01.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>
Subject: [axboe-block:for-5.18/io_uring 2/5] fs/io_uring.c:9406:9: warning: Uninitialized variable: ret [uninitvar]
Date: Thu, 10 Feb 2022 16:07:00 +0800	[thread overview]
Message-ID: <c418f925-b7df-da46-e4aa-f0d6af128490@intel.com> (raw)
In-Reply-To: <202202060419.bpwBH36K-lkp@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-5.18/io_uring
head:   971d72eb476604fc91a8e82f0421e6f599f9c300
commit: b77e315a96445e5f19a83546c73d2abbcedfa5db [2/5] io_uring: avoid ring quiesce while registering/unregistering eventfd
compiler: riscv64-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <yujie.liu@intel.com>

cppcheck possible warnings: (new ones prefixed by >>, may not be real problems)

 >> fs/io_uring.c:9406:9: warning: Uninitialized variable: ret [uninitvar]
     return ret;
            ^

vim +9406 fs/io_uring.c

634d00df5e1cfc Pavel Begunkov 2021-04-25  9379
9b402849e80c85 Jens Axboe     2019-04-11  9380  static int io_eventfd_register(struct io_ring_ctx *ctx, void __user *arg)
9b402849e80c85 Jens Axboe     2019-04-11  9381  {
b77e315a96445e Usama Arif     2022-02-04  9382  	struct io_ev_fd *ev_fd;
9b402849e80c85 Jens Axboe     2019-04-11  9383  	__s32 __user *fds = arg;
b77e315a96445e Usama Arif     2022-02-04  9384  	int fd, ret;
9b402849e80c85 Jens Axboe     2019-04-11  9385
b77e315a96445e Usama Arif     2022-02-04  9386  	ev_fd = rcu_dereference_protected(ctx->io_ev_fd,
b77e315a96445e Usama Arif     2022-02-04  9387  					lockdep_is_held(&ctx->uring_lock));
b77e315a96445e Usama Arif     2022-02-04  9388  	if (ev_fd)
9b402849e80c85 Jens Axboe     2019-04-11  9389  		return -EBUSY;
9b402849e80c85 Jens Axboe     2019-04-11  9390
9b402849e80c85 Jens Axboe     2019-04-11  9391  	if (copy_from_user(&fd, fds, sizeof(*fds)))
9b402849e80c85 Jens Axboe     2019-04-11  9392  		return -EFAULT;
9b402849e80c85 Jens Axboe     2019-04-11  9393
b77e315a96445e Usama Arif     2022-02-04  9394  	ev_fd = kmalloc(sizeof(*ev_fd), GFP_KERNEL);
b77e315a96445e Usama Arif     2022-02-04  9395  	if (!ev_fd)
b77e315a96445e Usama Arif     2022-02-04  9396  		return -ENOMEM;
fe7e3257502991 Pavel Begunkov 2021-06-24  9397
b77e315a96445e Usama Arif     2022-02-04  9398  	ev_fd->cq_ev_fd = eventfd_ctx_fdget(fd);
b77e315a96445e Usama Arif     2022-02-04  9399  	if (IS_ERR(ev_fd->cq_ev_fd)) {
b77e315a96445e Usama Arif     2022-02-04  9400  		ret = PTR_ERR(ev_fd->cq_ev_fd);
b77e315a96445e Usama Arif     2022-02-04  9401  		kfree(ev_fd);
9b402849e80c85 Jens Axboe     2019-04-11  9402  		return ret;
9b402849e80c85 Jens Axboe     2019-04-11  9403  	}
9b402849e80c85 Jens Axboe     2019-04-11  9404
b77e315a96445e Usama Arif     2022-02-04  9405  	rcu_assign_pointer(ctx->io_ev_fd, ev_fd);
b77e315a96445e Usama Arif     2022-02-04 @9406  	return ret;
b77e315a96445e Usama Arif     2022-02-04  9407  }
b77e315a96445e Usama Arif     2022-02-04  9408

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

           reply	other threads:[~2022-02-10  8:07 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <202202060419.bpwBH36K-lkp@intel.com>]

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=c418f925-b7df-da46-e4aa-f0d6af128490@intel.com \
    --to=yujie.liu@intel.com \
    --cc=axboe@kernel.dk \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=usama.arif@bytedance.com \
    /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

all inboxes | Powered by JetHome®