[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <164969331258.4207.11880527888370272207.tip-bot2@tip-bot2>
Date: Mon, 11 Apr 2022 16:08:32 -0000
From: "tip-bot2 for Yang Yingliang" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Hulk Robot <hulkci@...wei.com>,
Yang Yingliang <yangyingliang@...wei.com>,
Borislav Petkov <bp@...e.de>,
Brijesh Singh <brijesh.singh@....com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/sev] virt: sevguest: Fix return value check in alloc_shared_pages()
The following commit has been merged into the x86/sev branch of tip:
Commit-ID: e50abbf788c239d529f9ab81e325f8e8f8432c9d
Gitweb: https://git.kernel.org/tip/e50abbf788c239d529f9ab81e325f8e8f8432c9d
Author: Yang Yingliang <yangyingliang@...wei.com>
AuthorDate: Mon, 11 Apr 2022 19:12:13 +08:00
Committer: Borislav Petkov <bp@...e.de>
CommitterDate: Mon, 11 Apr 2022 17:58:52 +02:00
virt: sevguest: Fix return value check in alloc_shared_pages()
If alloc_pages() fails, it returns a NULL pointer. Replace the wrong
IS_ERR() check with the proper NULL pointer check.
Fixes: fce96cf04430 ("virt: Add SEV-SNP guest driver")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Reviewed-by: Brijesh Singh <brijesh.singh@....com>
Link: https://lore.kernel.org/r/20220411111213.1477853-1-yangyingliang@huawei.com
---
drivers/virt/coco/sevguest/sevguest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/virt/coco/sevguest/sevguest.c b/drivers/virt/coco/sevguest/sevguest.c
index 15afb6c..aaa6134 100644
--- a/drivers/virt/coco/sevguest/sevguest.c
+++ b/drivers/virt/coco/sevguest/sevguest.c
@@ -581,7 +581,7 @@ static void *alloc_shared_pages(size_t sz)
int ret;
page = alloc_pages(GFP_KERNEL_ACCOUNT, get_order(sz));
- if (IS_ERR(page))
+ if (!page)
return NULL;
ret = set_memory_decrypted((unsigned long)page_address(page), npages);
Powered by blists - more mailing lists