crypto: hisilicon/hpre - fix unmapping invalid dma address
authorHui Tang <tanghui20@huawei.com>
Mon, 10 May 2021 09:02:55 +0000 (17:02 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 May 2021 08:17:30 +0000 (16:17 +0800)
commit0b0553b701f830d820ba9026e5799c24e400a4b5
treebb79515307a0813ffcb345594f2006eb5a4a2001
parenta225762057d6818e4a75ad5c2c16495662d71495
crypto: hisilicon/hpre - fix unmapping invalid dma address

Currently, an invalid dma address may be unmapped when calling
'xx_data_clr_all' in error path, so check dma address of sqe in/out
if initialized before calling 'dma_free_coherent' or 'dma_unmap_single'.

Fixes: a9214b0b6ed2 ("crypto: hisilicon - fix the check on dma address")
Signed-off-by: Hui Tang <tanghui20@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/hpre/hpre_crypto.c