crypto: ccp - Fix oops by properly managing allocated structures
authorGary R Hook <gary.hook@amd.com>
Tue, 30 Jul 2019 16:05:22 +0000 (16:05 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 2 Aug 2019 04:36:29 +0000 (14:36 +1000)
commit25e44338321af545ab34243a6081c3f0fc6107d0
tree9517547e8177a815c50fca353b6f8bed99a290aa
parentcf144f81a99d1a3928f90b0936accfd3f45c9a0a
crypto: ccp - Fix oops by properly managing allocated structures

A plaintext or ciphertext length of 0 is allowed in AES, in which case
no encryption occurs. Ensure that we don't clean up data structures
that were never allocated.

Fixes: 36cf515b9bbe2 ("crypto: ccp - Enable support for AES GCM on v5 CCPs")
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>
drivers/crypto/ccp/ccp-ops.c