From: kernel test robot <lkp@intel.com>
To: Xu Yilun <yilun.xu@linux.intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [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
Date: Sat, 12 Sep 2026 14:39:54 +0200 [thread overview]
Message-ID: <202609121407.f92etiw5-lkp@intel.com> (raw)
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
reply other threads:[~2026-09-12 12:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202609121407.f92etiw5-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=yilun.xu@linux.intel.com \
/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 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.