mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
crypto/ccp: Skip SNP_INIT if preparation fails
If snp_prepare() fails, SNP_INIT will fail, so skip it and return early. Note that this is not a change in initialization behavior: if SNP_INIT fails even before this change, it will still return an error and __sev_snp_init_locked() will fail initialization of other SEV modes. Signed-off-by: Tycho Andersen (AMD) <tycho@kernel.org> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Nikunj A Dadhania <nikunj@amd.com> Link: https://lore.kernel.org/20260429155636.540040-1-tycho@kernel.org
This commit is contained in:
parent
39f1de2fff
commit
e9d29f4a91
|
|
@ -1374,7 +1374,9 @@ static int __sev_snp_init_locked(int *error, unsigned int max_snp_asid)
|
|||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
snp_prepare();
|
||||
rc = snp_prepare();
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
/*
|
||||
* Starting in SNP firmware v1.52, the SNP_INIT_EX command takes a list
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user