@@ -2069,7 +2069,7 @@ static int __init snp_get_tsc_info(void)
2069
2069
struct snp_tsc_info_resp * tsc_resp ;
2070
2070
struct snp_tsc_info_req * tsc_req ;
2071
2071
struct snp_msg_desc * mdesc ;
2072
- struct snp_guest_req * req ;
2072
+ struct snp_guest_req req = {} ;
2073
2073
int rc = - ENOMEM ;
2074
2074
2075
2075
tsc_req = kzalloc (sizeof (* tsc_req ), GFP_KERNEL );
@@ -2085,28 +2085,24 @@ static int __init snp_get_tsc_info(void)
2085
2085
if (!tsc_resp )
2086
2086
goto e_free_tsc_req ;
2087
2087
2088
- req = kzalloc (sizeof (* req ), GFP_KERNEL );
2089
- if (!req )
2090
- goto e_free_tsc_resp ;
2091
-
2092
2088
mdesc = snp_msg_alloc ();
2093
2089
if (IS_ERR_OR_NULL (mdesc ))
2094
- goto e_free_req ;
2090
+ goto e_free_tsc_resp ;
2095
2091
2096
2092
rc = snp_msg_init (mdesc , snp_vmpl );
2097
2093
if (rc )
2098
2094
goto e_free_mdesc ;
2099
2095
2100
- req -> msg_version = MSG_HDR_VER ;
2101
- req -> msg_type = SNP_MSG_TSC_INFO_REQ ;
2102
- req -> vmpck_id = snp_vmpl ;
2103
- req -> req_buf = tsc_req ;
2104
- req -> req_sz = sizeof (* tsc_req );
2105
- req -> resp_buf = (void * )tsc_resp ;
2106
- req -> resp_sz = sizeof (* tsc_resp ) + AUTHTAG_LEN ;
2107
- req -> exit_code = SVM_VMGEXIT_GUEST_REQUEST ;
2096
+ req . msg_version = MSG_HDR_VER ;
2097
+ req . msg_type = SNP_MSG_TSC_INFO_REQ ;
2098
+ req . vmpck_id = snp_vmpl ;
2099
+ req . req_buf = tsc_req ;
2100
+ req . req_sz = sizeof (* tsc_req );
2101
+ req . resp_buf = (void * )tsc_resp ;
2102
+ req . resp_sz = sizeof (* tsc_resp ) + AUTHTAG_LEN ;
2103
+ req . exit_code = SVM_VMGEXIT_GUEST_REQUEST ;
2108
2104
2109
- rc = snp_send_guest_request (mdesc , req );
2105
+ rc = snp_send_guest_request (mdesc , & req );
2110
2106
if (rc )
2111
2107
goto e_request ;
2112
2108
@@ -2127,9 +2123,7 @@ static int __init snp_get_tsc_info(void)
2127
2123
memzero_explicit (tsc_resp , sizeof (* tsc_resp ) + AUTHTAG_LEN );
2128
2124
e_free_mdesc :
2129
2125
snp_msg_free (mdesc );
2130
- e_free_req :
2131
- kfree (req );
2132
- e_free_tsc_resp :
2126
+ e_free_tsc_resp :
2133
2127
kfree (tsc_resp );
2134
2128
e_free_tsc_req :
2135
2129
kfree (tsc_req );
0 commit comments