Skip to content

Commit 8e6173c

Browse files
Gilad Ben-Yossefgregkh
authored andcommitted
staging: ccree: check DMA pool buf !NULL before free
commit 2f7caf6 upstream. If we ran out of DMA pool buffers, we get into the unmap code path with a NULL before. Deal with this by checking the virtual mapping is not NULL. Cc: stable@vger.kernel.org Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 61377bc commit 8e6173c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/staging/ccree/ssi_buffer_mgr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,8 @@ void ssi_buffer_mgr_unmap_blkcipher_request(
492492
DMA_TO_DEVICE);
493493
}
494494
/* Release pool */
495-
if (req_ctx->dma_buf_type == SSI_DMA_BUF_MLLI) {
495+
if (req_ctx->dma_buf_type == SSI_DMA_BUF_MLLI &&
496+
req_ctx->mlli_params.mlli_virt_addr) {
496497
dma_pool_free(req_ctx->mlli_params.curr_pool,
497498
req_ctx->mlli_params.mlli_virt_addr,
498499
req_ctx->mlli_params.mlli_dma_addr);

0 commit comments

Comments
 (0)