Skip to contentSkip to conversation

x86/sev: Remove unnecessary GFP_KERNEL_ACCOUNT for temporary variables

PATCH Applied [email protected] 2 participants 2 messages Apr 28, 2025 – May 2, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/sev: Remove unnecessary GFP_KERNEL_ACCOUNT for temporary variables

From: Peng Hao <[email protected]>

Some variables allocated in sev_send_update_data are released when the function exits, so there is no need to set GFP_KERNEL_ACCOUNT.

---
 arch/x86/kvm/svm/sev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/svm/sev.c +2 -2
index 0dbb25442ec1..365e6057b04c 100644
@@ -1608,11 +1608,11 @@ static int sev_send_update_data(struct kvm *kvm, struct kvm_sev_cmd *argp)
 
 	/* allocate memory for header and transport buffer */
 	ret = -ENOMEM;
-	hdr = kzalloc(params.hdr_len, GFP_KERNEL_ACCOUNT);
+	hdr = kzalloc(params.hdr_len, GFP_KERNEL);
 	if (!hdr)
 		goto e_unpin;
 
-	trans_data = kzalloc(params.trans_len, GFP_KERNEL_ACCOUNT);
+	trans_data = kzalloc(params.trans_len, GFP_KERNEL);
 	if (!trans_data)
 		goto e_free_hdr;
 
Signature · 1 line
2.27.0