>@@ -147,11 +278,17 @@ static int __init __tdx_bringup(void) > goto get_sysinfo_err; > } > >+ /* Check TDX module and KVM capabilities */ >+ if (!tdx_get_supported_attrs(&tdx_sysinfo->td_conf) || >+ !tdx_get_supported_xfam(&tdx_sysinfo->td_conf)) >+ goto get_sysinfo_err; The return value should be set to -EINVAL before the goto. >+ > /* > * Leave hardware virtualization enabled after TDX is enabled > * successfully. TDX CPU hotplug depends on this. > */ > return 0; >+ > get_sysinfo_err: > __do_tdx_cleanup(); > tdx_bringup_err: >-- >2.47.0 > >