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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:13:45 +0000 (10:13 +0200)
commit45511e4d8940733d31be7a4b81963c629703d8dc
tree75798184b594dd14c6f8697e5f0d9b6a1162aa26
parent9af22331765a05cf12d8a521641ca133111a68cc
crypto: ccp - Fix oops by properly managing allocated structures

commit 25e44338321af545ab34243a6081c3f0fc6107d0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/ccp/ccp-ops.c