crypto: crypto4xx - fix double-free in crypto4xx_destroy_sdr
authorChristian Lamparter <chunkeey@gmail.com>
Thu, 31 Oct 2019 16:14:38 +0000 (17:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Dec 2019 07:43:04 +0000 (08:43 +0100)
commit1e863b723ee08ecf0ec650a34a94cd54a232bfde
tree6edc9f8fe5ea2f1a0c207934c31260a77e6150eb
parentd61ce964332add7ea55ac41173000f3527a25e1f
crypto: crypto4xx - fix double-free in crypto4xx_destroy_sdr

commit 746c908c4d72e49068ab216c3926d2720d71a90d upstream.

This patch fixes a crash that can happen during probe
when the available dma memory is not enough (this can
happen if the crypto4xx is built as a module).

The descriptor window mapping would end up being free'd
twice, once in crypto4xx_build_pdr() and the second time
in crypto4xx_destroy_sdr().

Fixes: 5d59ad6eea82 ("crypto: crypto4xx - fix crypto4xx_build_pdr, crypto4xx_build_sdr leak")
Cc: <stable@vger.kernel.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/amcc/crypto4xx_core.c