crypto: qat - unmap buffers before free for RSA
authorHareshx Sankar Raj <hareshx.sankar.raj@intel.com>
Mon, 5 Jun 2023 21:06:07 +0000 (22:06 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 16 Jun 2023 12:30:35 +0000 (20:30 +0800)
commitd776b25495f2c71b9dbf1f5e53b642215ba72f3c
treec2d73156359e0e5746a49affd6d7f3188ddf446e
parenteb7713f5ca97697b92f225127440d1525119b8de
crypto: qat - unmap buffers before free for RSA

The callback function for RSA frees the memory allocated for the source
and destination buffers before unmapping them.
This sequence is wrong.

Change the cleanup sequence to unmap the buffers before freeing them.

Fixes: 3dfaf0071ed7 ("crypto: qat - remove dma_free_coherent() for RSA")
Signed-off-by: Hareshx Sankar Raj <hareshx.sankar.raj@intel.com>
Co-developed-by: Bolemx Sivanagaleela <bolemx.sivanagaleela@intel.com>
Signed-off-by: Bolemx Sivanagaleela <bolemx.sivanagaleela@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/intel/qat/qat_common/qat_asym_algs.c