virt: sevguest: Fix return value check in alloc_shared_pages()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 11 Apr 2022 11:12:13 +0000 (19:12 +0800)
committerBorislav Petkov <bp@suse.de>
Mon, 11 Apr 2022 15:58:52 +0000 (17:58 +0200)
commite50abbf788c239d529f9ab81e325f8e8f8432c9d
treec9b84f157369ad9c3bc5ff0845790461ca3c651a
parente720ea52e85c9d00cf8c5769795d0a3e585524f6
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@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
drivers/virt/coco/sevguest/sevguest.c