crypto: ccp - Ignore unconfigured CCP device on suspend/resume
authorGary R Hook <gary.hook@amd.com>
Mon, 19 Aug 2019 22:23:27 +0000 (22:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Sep 2019 08:20:59 +0000 (10:20 +0200)
commitd204cf4f3169e33111f1b1e51000988108558fe9
treecc0c29522a03dda38883715b43f516ef54e3d253
parent573710846402a868f56fea58be26b313f28ccf07
crypto: ccp - Ignore unconfigured CCP device on suspend/resume

commit 5871cd93692c8071fb9358daccb715b5081316ac upstream.

If a CCP is unconfigured (e.g. there are no available queues) then
there will be no data structures allocated for the device. Thus, we
must check for validity of a pointer before trying to access structure
members.

Fixes: 720419f01832f ("crypto: ccp - Introduce the AMD Secure Processor device")
Cc: <stable@vger.kernel.org>
Signed-off-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/ccp/ccp-dev.c