Commit 510c47f
KVM: TDX: Fix uninitialized error code for __tdx_bringup()
Fix a Smatch static checker warning reported by Dan:
arch/x86/kvm/vmx/tdx.c:3464 __tdx_bringup()
warn: missing error code 'r'
Initialize r to -EINVAL before tdx_get_sysinfo() to simplify the code and
to prevent similar issues from sneaking in later on as suggested by Kai.
Cc: stable@vger.kernel.org
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: 61bb282 ("KVM: TDX: Get system-wide info about TDX module on initialization")
Suggested-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Tony Lindgren <tony.lindgren@linux.intel.com>
Link: https://lore.kernel.org/r/20250918053226.802204-1-tony.lindgren@linux.intel.com
[sean: tag for stable]
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent 7cbb14d commit 510c47f
1 file changed
+3
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3457 | 3457 | | |
3458 | 3458 | | |
3459 | 3459 | | |
| 3460 | + | |
3460 | 3461 | | |
3461 | 3462 | | |
3462 | | - | |
3463 | | - | |
| 3463 | + | |
3464 | 3464 | | |
3465 | | - | |
3466 | 3465 | | |
3467 | 3466 | | |
3468 | 3467 | | |
| |||
3505 | 3504 | | |
3506 | 3505 | | |
3507 | 3506 | | |
3508 | | - | |
3509 | 3507 | | |
3510 | 3508 | | |
3511 | 3509 | | |
3512 | | - | |
3513 | | - | |
| 3510 | + | |
3514 | 3511 | | |
3515 | | - | |
3516 | 3512 | | |
3517 | 3513 | | |
3518 | 3514 | | |
| |||
0 commit comments