linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [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]
       [not found] <202205081711.ssgxsL9Z-lkp@intel.com>
@ 2022-05-09  3:25 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-05-09  3:25 UTC (permalink / raw)
  To: Kanchan Joshi
  Cc: llvm, kbuild-all, Linux Memory Management List, Jens Axboe,
	Anuj Gupta, Christoph Hellwig

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-09  3:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <202205081711.ssgxsL9Z-lkp@intel.com>
2022-05-09  3:25 ` [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] kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox