summaryrefslogtreecommitdiffstats
path: root/drivers/virt/coco/tdx-guest/tdx-guest.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/virt/coco/tdx-guest/tdx-guest.c')
-rw-r--r--drivers/virt/coco/tdx-guest/tdx-guest.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/virt/coco/tdx-guest/tdx-guest.c b/drivers/virt/coco/tdx-guest/tdx-guest.c
index d7db6c824e13..224e7dde9cde 100644
--- a/drivers/virt/coco/tdx-guest/tdx-guest.c
+++ b/drivers/virt/coco/tdx-guest/tdx-guest.c
@@ -124,10 +124,8 @@ static void *alloc_quote_buf(void)
if (!addr)
return NULL;
- if (set_memory_decrypted((unsigned long)addr, count)) {
- free_pages_exact(addr, len);
+ if (set_memory_decrypted((unsigned long)addr, count))
return NULL;
- }
return addr;
}