* request for 4.14-stable: 2f7caf6b0214 ("staging: ccree: check DMA pool buf !NULL before free")
@ 2018-10-16 21:10 Sudip Mukherjee
2018-10-18 16:56 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2018-10-16 21:10 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: stable, Gilad Ben-Yossef
[-- Attachment #1: Type: text/plain, Size: 89 bytes --]
Hi Greg,
This was missing in 4.14-stable. Please apply to your queue.
--
Regards
Sudip
[-- Attachment #2: 0001-staging-ccree-check-DMA-pool-buf-NULL-before-free.patch --]
[-- Type: text/x-diff, Size: 1373 bytes --]
>From 54d3be6bb683da40fc5bc6b89b6553ca83030fe9 Mon Sep 17 00:00:00 2001
From: Gilad Ben-Yossef <gilad@benyossef.com>
Date: Sun, 7 Jan 2018 12:14:24 +0000
Subject: [PATCH] staging: ccree: check DMA pool buf !NULL before free
commit 2f7caf6b02145bd9cd9d0b56204f51a5fefe7790 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
drivers/staging/ccree/ssi_buffer_mgr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/ccree/ssi_buffer_mgr.c b/drivers/staging/ccree/ssi_buffer_mgr.c
index 63936091d524..4ba6e9c422c4 100644
--- a/drivers/staging/ccree/ssi_buffer_mgr.c
+++ b/drivers/staging/ccree/ssi_buffer_mgr.c
@@ -492,7 +492,8 @@ void ssi_buffer_mgr_unmap_blkcipher_request(
DMA_TO_DEVICE);
}
/* Release pool */
- if (req_ctx->dma_buf_type == SSI_DMA_BUF_MLLI) {
+ if (req_ctx->dma_buf_type == SSI_DMA_BUF_MLLI &&
+ req_ctx->mlli_params.mlli_virt_addr) {
dma_pool_free(req_ctx->mlli_params.curr_pool,
req_ctx->mlli_params.mlli_virt_addr,
req_ctx->mlli_params.mlli_dma_addr);
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-19 0:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-16 21:10 request for 4.14-stable: 2f7caf6b0214 ("staging: ccree: check DMA pool buf !NULL before free") Sudip Mukherjee
2018-10-18 16:56 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox