linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <yujie.liu@intel.com>
To: Kanchan Joshi <joshi.k@samsung.com>
Cc: <llvm@lists.linux.dev>, <kbuild-all@lists.01.org>,
	"Linux Memory Management List" <linux-mm@kvack.org>,
	Jens Axboe <axboe@kernel.dk>, "Anuj Gupta" <anuj20.g@samsung.com>,
	Christoph Hellwig <hch@lst.de>
Subject: [linux-next:master 9659/9759] drivers/nvme/host/ioctl.c:693:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
Date: Mon, 9 May 2022 11:25:54 +0800	[thread overview]
Message-ID: <028fae20-bb0e-183c-e0f9-041a0b50bbb3@intel.com> (raw)
In-Reply-To: <202205081711.ssgxsL9Z-lkp@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   38a288f5941ef03752887ad86f2d85442358c99a
commit: 86116c2f6fee81a0be72a71cc2f1f7c087df8efa [9659/9759] nvme: wire-up uring-cmd support for io-passthru on char-device.
config: i386-randconfig-c001 (https://download.01.org/0day-ci/archive/20220508/202205081711.ssgxsL9Z-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5e004fb787698440a387750db7f8028e7cb14cfc)
reproduce (this is a W=1 build):
         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
         chmod +x ~/bin/make.cross
         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=86116c2f6fee81a0be72a71cc2f1f7c087df8efa
         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
         git fetch --no-tags linux-next master
         git checkout 86116c2f6fee81a0be72a71cc2f1f7c087df8efa
         # save the config file
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer

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


clang-analyzer warnings: (new ones prefixed by >>)

 >> drivers/nvme/host/ioctl.c:693:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
            return ret;
            ^      ~~~
    drivers/nvme/host/ioctl.c:688:2: note: 'ret' declared without an initial value
            int ret;
            ^~~~~~~
    drivers/nvme/host/ioctl.c:690:2: note: Assuming 'ns' is null
            if (ns)
            ^
    drivers/nvme/host/ioctl.c:690:2: note: Taking false branch
            if (ns)
            ^
    drivers/nvme/host/ioctl.c:693:2: note: Undefined or garbage value returned to caller
            return ret;
            ^      ~~~

vim +693 drivers/nvme/host/ioctl.c

86116c2f6fee81 Kanchan Joshi     2022-05-05  680
86116c2f6fee81 Kanchan Joshi     2022-05-05  681  int nvme_ns_head_chr_uring_cmd(struct io_uring_cmd *ioucmd,
86116c2f6fee81 Kanchan Joshi     2022-05-05  682  		unsigned int issue_flags)
86116c2f6fee81 Kanchan Joshi     2022-05-05  683  {
86116c2f6fee81 Kanchan Joshi     2022-05-05  684  	struct cdev *cdev = file_inode(ioucmd->file)->i_cdev;
86116c2f6fee81 Kanchan Joshi     2022-05-05  685  	struct nvme_ns_head *head = container_of(cdev, struct nvme_ns_head, cdev);
86116c2f6fee81 Kanchan Joshi     2022-05-05  686  	int srcu_idx = srcu_read_lock(&head->srcu);
86116c2f6fee81 Kanchan Joshi     2022-05-05  687  	struct nvme_ns *ns = nvme_find_path(head);
86116c2f6fee81 Kanchan Joshi     2022-05-05  688  	int ret;
86116c2f6fee81 Kanchan Joshi     2022-05-05  689
86116c2f6fee81 Kanchan Joshi     2022-05-05  690  	if (ns)
86116c2f6fee81 Kanchan Joshi     2022-05-05  691  		ret = nvme_ns_uring_cmd(ns, ioucmd, issue_flags);
86116c2f6fee81 Kanchan Joshi     2022-05-05  692  	srcu_read_unlock(&head->srcu, srcu_idx);
86116c2f6fee81 Kanchan Joshi     2022-05-05 @693  	return ret;
86116c2f6fee81 Kanchan Joshi     2022-05-05  694  }
2405252a680e21 Christoph Hellwig 2021-04-10  695  #endif /* CONFIG_NVME_MULTIPATH */
2405252a680e21 Christoph Hellwig 2021-04-10  696

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


           reply	other threads:[~2022-05-09  3:26 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <202205081711.ssgxsL9Z-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=028fae20-bb0e-183c-e0f9-041a0b50bbb3@intel.com \
    --to=yujie.liu@intel.com \
    --cc=anuj20.g@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=joshi.k@samsung.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@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