]> git.baikalelectronics.ru Git - kernel.git/commit
x86/sev-es: Don't return NULL from sev_es_get_ghcb()
authorJoerg Roedel <jroedel@suse.de>
Wed, 19 May 2021 13:52:44 +0000 (15:52 +0200)
committerBorislav Petkov <bp@suse.de>
Wed, 19 May 2021 15:05:13 +0000 (17:05 +0200)
commitfeb58f09560c79d58d4b580bce1b5cadb89099ac
tree4654885a45f8f98867f4b7f3f023581d97fa771b
parenteab9ae7e99e75b3d69429e5c605a0d2024bda4c4
x86/sev-es: Don't return NULL from sev_es_get_ghcb()

sev_es_get_ghcb() is called from several places but only one of them
checks the return value. The reaction to returning NULL is always the
same: calling panic() and kill the machine.

Instead of adding checks to all call sites, move the panic() into the
function itself so that it will no longer return NULL.

Fixes: 6caf56f2db40 ("x86/sev-es: Add a Runtime #VC Exception Handler")
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: stable@vger.kernel.org # v5.10+
Link: https://lkml.kernel.org/r/20210519135251.30093-2-joro@8bytes.org
arch/x86/kernel/sev.c