]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: caam - fix DMA API leaks for multiple setkey() calls
authorHoria Geantă <horia.geanta@nxp.com>
Fri, 10 Feb 2017 12:07:22 +0000 (14:07 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 15 Feb 2017 05:23:41 +0000 (13:23 +0800)
commit11e854b456c3cf8c276420843c5c8917fabf481b
treeacff483ada06a7a1602dd7070aa31fa750951a33
parent5c0d69aee7126ec9add5d7e8a95c08d55e9dca85
crypto: caam - fix DMA API leaks for multiple setkey() calls

setkey() callback may be invoked multiple times for the same tfm.
In this case, DMA API leaks are caused by shared descriptors
(and key for caamalg) being mapped several times and unmapped only once.
Fix this by performing mapping / unmapping only in crypto algorithm's
cra_init() / cra_exit() callbacks and sync_for_device in the setkey()
tfm callback.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caamalg.c
drivers/crypto/caam/caamhash.c