kernel-fxtec-pro1x/drivers/crypto/ccp
Tom Lendacky afb31cd2d1 crypto: ccp - Check for NULL PSP pointer at module unload
Should the PSP initialization fail, the PSP data structure will be
freed and the value contained in the sp_device struct set to NULL.
At module unload, psp_dev_destroy() does not check if the pointer
value is NULL and will end up dereferencing a NULL pointer.

Add a pointer check of the psp_data field in the sp_device struct
in psp_dev_destroy() and return immediately if it is NULL.

Cc: <stable@vger.kernel.org> # 4.16.x-
Fixes: 2a6170dfe7 ("crypto: ccp: Add Platform Security Processor (PSP) device support")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2018-08-03 18:06:05 +08:00
..
ccp-crypto-aes-cmac.c
ccp-crypto-aes-galois.c
ccp-crypto-aes-xts.c
ccp-crypto-aes.c
ccp-crypto-des3.c
ccp-crypto-main.c
ccp-crypto-rsa.c
ccp-crypto-sha.c
ccp-crypto.h
ccp-debugfs.c
ccp-dev-v3.c
ccp-dev-v5.c
ccp-dev.c
ccp-dev.h
ccp-dmaengine.c
ccp-ops.c
Kconfig
Makefile
psp-dev.c crypto: ccp - Check for NULL PSP pointer at module unload 2018-08-03 18:06:05 +08:00
psp-dev.h
sp-dev.c
sp-dev.h
sp-pci.c
sp-platform.c