Skip to contentSkip to conversation

drivers/nvme/target/core.c:1018:10: warning: variable 'ret' is uninitialized when used here

PATCH kernel test robot 1 participant 1 message May 9, 2025 NVMe

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   git://git.infradead.org/nvme.git nvme-6.16
head:   a0136c6ac4a9aba90a47b9c691bc299a113b5259
commit: 206372d7c565174e6b8289dac03077b23b8369c9 [11/14] nvmet: support completion queue sharing
config: s390-randconfig-002-20250509 (https://download.01.org/0day-ci/archive/20250509/[email protected]/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250509/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/nvme/target/core.c:1018:10: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
    1018 |                 return ret;
         |                        ^~~
   drivers/nvme/target/core.c:1015:9: note: initialize the variable 'ret' to silence this warning
    1015 |         int ret;
         |                ^
         |                 = 0

1 warning generated.

vim +/ret +1018 drivers/nvme/target/core.c

1012
1013 int nvmet_sq_init(struct nvmet_sq *sq, struct nvmet_cq *cq)
1014 {
1015 int ret;
1016
1017 if (!nvmet_cq_get(cq))

> 1018			return ret;

1019
1020 ret = percpu_ref_init(&sq->ref, nvmet_sq_free, 0, GFP_KERNEL);
1021 if (ret) {
1022 pr_err("percpu_ref init failed!\n");
1023 nvmet_cq_put(cq);
1024 return ret;
1025 }
1026 init_completion(&sq->free_done);
1027 init_completion(&sq->confirm_done);
1028 nvmet_auth_sq_init(sq);
1029 sq->cq = cq;
1030
1031 return 0;
1032 }
1033 EXPORT_SYMBOL_GPL(nvmet_sq_init);
1034

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