* [linux-nvme:nvme-5.12 7/9] drivers/nvme/host/core.c:4100 nvme_validate_or_alloc_ns() error: we previously assumed 'ns' could be null (see line 4082)
@ 2021-03-12 19:30 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-03-12 19:30 UTC (permalink / raw)
To: Chaitanya Kulkarni; +Cc: kbuild-all, linux-nvme, Christoph Hellwig
[-- Attachment #1: Type: text/plain, Size: 2049 bytes --]
tree: git://git.infradead.org/nvme.git nvme-5.12
head: abbb5f5929ec6c52574c430c5475c158a65c2a8c
commit: 0ec84df4953bd42c6583a555773f1d4996a061eb [7/9] nvme-core: check ctrl css before setting up zns
config: i386-randconfig-m021-20210312 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
New smatch warnings:
drivers/nvme/host/core.c:4100 nvme_validate_or_alloc_ns() error: we previously assumed 'ns' could be null (see line 4082)
Old smatch warnings:
drivers/nvme/host/core.c:692 nvme_configure_directives() warn: missing error code 'ret'
drivers/nvme/host/core.c:788 nvme_setup_discard() warn: possible memory leak of 'range'
vim +/ns +4100 drivers/nvme/host/core.c
4072
4073 static void nvme_validate_or_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
4074 {
4075 struct nvme_ns_ids ids = { };
4076 struct nvme_ns *ns;
4077
4078 if (nvme_identify_ns_descs(ctrl, nsid, &ids))
4079 return;
4080
4081 ns = nvme_find_get_ns(ctrl, nsid);
> 4082 if (ns) {
4083 nvme_validate_ns(ns, &ids);
4084 nvme_put_ns(ns);
4085 return;
4086 }
4087
4088 switch (ids.csi) {
4089 case NVME_CSI_NVM:
4090 nvme_alloc_ns(ctrl, nsid, &ids);
4091 break;
4092 case NVME_CSI_ZNS:
4093 if (!IS_ENABLED(CONFIG_BLK_DEV_ZONED)) {
4094 dev_warn(ctrl->device,
4095 "nsid %u not supported without CONFIG_BLK_DEV_ZONED\n",
4096 nsid);
4097 break;
4098 }
4099 if (!nvme_multi_css(ctrl)) {
> 4100 dev_warn(ctrl->device,
4101 "command set not reported for nsid: %d\n",
4102 ns->head->ns_id);
4103 break;
4104 }
4105 nvme_alloc_ns(ctrl, nsid, &ids);
4106 break;
4107 default:
4108 dev_warn(ctrl->device, "unknown csi %u for nsid %u\n",
4109 ids.csi, nsid);
4110 break;
4111 }
4112 }
4113
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33745 bytes --]
[-- Attachment #3: Type: text/plain, Size: 158 bytes --]
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-12 19:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 19:30 [linux-nvme:nvme-5.12 7/9] drivers/nvme/host/core.c:4100 nvme_validate_or_alloc_ns() error: we previously assumed 'ns' could be null (see line 4082) 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;
as well as URLs for NNTP newsgroup(s).