All of lore.kernel.org
 help / color / mirror / Atom feed
* [intel-tdx:tdisp_phase1 24/34] drivers/virt/coco/tdx-host/tdx-host.c:222:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true
@ 2026-09-12 12:39 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-12 12:39 UTC (permalink / raw)
  To: Xu Yilun; +Cc: oe-kbuild-all

tree:   https://github.com/intel/tdx.git tdisp_phase1
head:   9ed1a749a8eadfcaf42268f321a1569907d5efbc
commit: b88bd1acf12bf8d5e9501fe72f8544597143a874 [24/34] coco/tdx-host: Establish an SPDM session with the device
config: x86_64-allmodconfig (https://download.01.org/0day-ci/archive/20260912/202609121407.f92etiw5-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260912/202609121407.f92etiw5-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609121407.f92etiw5-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/virt/coco/tdx-host/tdx-host.c:222:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     222 |         if (!out_msg_page)
         |             ^~~~~~~~~~~~~
   drivers/virt/coco/tdx-host/tdx-host.c:244:9: note: uninitialized use occurs here
     244 |         return ret;
         |                ^~~
   drivers/virt/coco/tdx-host/tdx-host.c:222:2: note: remove the 'if' if its condition is always false
     222 |         if (!out_msg_page)
         |         ^~~~~~~~~~~~~~~~~~
     223 |                 goto out_free_in_msg;
         |                 ~~~~~~~~~~~~~~~~~~~~
   drivers/virt/coco/tdx-host/tdx-host.c:215:9: note: initialize the variable 'ret' to silence this warning
     215 |         int ret;
         |                ^
         |                 = 0
   1 warning generated.


vim +222 drivers/virt/coco/tdx-host/tdx-host.c

   211	
   212	static int tdx_spdm_session_setup(struct tdx_tsm_link *tlink)
   213	{
   214		struct page *in_msg_page, *out_msg_page;
   215		int ret;
   216	
   217		in_msg_page = alloc_page(GFP_KERNEL | __GFP_ZERO);
   218		if (!in_msg_page)
   219			return -ENOMEM;
   220	
   221		out_msg_page = alloc_page(GFP_KERNEL | __GFP_ZERO);
 > 222		if (!out_msg_page)
   223			goto out_free_in_msg;
   224	
   225		tlink->in_msg = in_msg_page;
   226		tlink->out_msg = out_msg_page;
   227	
   228		ret = tdx_spdm_create(tlink);
   229		if (ret)
   230			goto out_free_out_msg;
   231	
   232		ret = tdx_spdm_session_connect(tlink);
   233		if (ret)
   234			goto out_spdm_delete;
   235	
   236		return 0;
   237	
   238	out_spdm_delete:
   239		tdx_spdm_delete(tlink);
   240	out_free_out_msg:
   241		__free_page(out_msg_page);
   242	out_free_in_msg:
   243		__free_page(in_msg_page);
   244		return ret;
   245	}
   246	

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

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

only message in thread, other threads:[~2026-09-12 12:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-12 12:39 [intel-tdx:tdisp_phase1 24/34] drivers/virt/coco/tdx-host/tdx-host.c:222:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.