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: fce96cf044
("virt: Add SEV-SNP guest driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Link: https://lore.kernel.org/r/20220411111213.1477853-1-yangyingliang@huawei.com
This commit is contained in:
parent
e720ea52e8
commit
e50abbf788
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user