crypto: ccp - Fail the PSP initialization when writing psp data file failed

Currently the OS continues the PSP initialization when there is a write
failure to the init_ex_file. Therefore, the userspace would be told that
SEV is properly INIT'd even though the psp data file is not updated.
This is problematic because later when asked for the SEV data, the OS
won't be able to provide it.

Fixes: 3d725965f836 ("crypto: ccp - Add SEV_INIT_EX support")
Reported-by: Peter Gonda <>
Reported-by: kernel test robot <>
Signed-off-by: Jacky Li <>
Acked-by: David Rientjes <>
Acked-by: Tom Lendacky <>
Signed-off-by: Herbert Xu <>
1 file changed