crypto: ccp - ccp_dmaengine_unregister release dma channels
authorDāvis Mosāns <davispuh@gmail.com>
Mon, 28 Feb 2022 03:15:45 +0000 (05:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:09 +0000 (14:23 +0200)
commit20550eb187e83453c68a3de80844f94955355309
treed43f815b0478e763a98779998536caf7eb46fe43
parent166b2478152c217213d532c08ce27d2d9dc82e61
crypto: ccp - ccp_dmaengine_unregister release dma channels

[ Upstream commit 54cce8ecb9254f971b40a72911c6da403720a2d2 ]

ccp_dmaengine_register adds dma_chan->device_node to dma_dev->channels list
but ccp_dmaengine_unregister didn't remove them.
That can cause crashes in various dmaengine methods that tries to use dma_dev->channels

Fixes: 58ea8abf4904 ("crypto: ccp - Register the CCP as a DMA...")
Signed-off-by: Dāvis Mosāns <davispuh@gmail.com>
Acked-by: John Allen <john.allen@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/ccp/ccp-dmaengine.c