diff mbox series

[4/4] crypto: ccree: fix backlog memory leak

Message ID 20191127084909.14472-5-gilad@benyossef.com
State Accepted
Commit 4df2ef25b3b3618fd708ab484fe6239abd130fec
Headers show
Series [1/4] crypto: ccree: remove useless define | expand

Commit Message

Gilad Ben-Yossef Nov. 27, 2019, 8:49 a.m. UTC
Fix brown paper bag bug of not releasing backlog list item buffer
when backlog was consumed causing a memory leak when backlog is
used.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>

Cc: stable@vger.kernel.org # v4.19+
---
 drivers/crypto/ccree/cc_request_mgr.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.23.0
diff mbox series

Patch

diff --git a/drivers/crypto/ccree/cc_request_mgr.c b/drivers/crypto/ccree/cc_request_mgr.c
index 3ed3164820eb..a5606dc04b06 100644
--- a/drivers/crypto/ccree/cc_request_mgr.c
+++ b/drivers/crypto/ccree/cc_request_mgr.c
@@ -404,6 +404,7 @@  static void cc_proc_backlog(struct cc_drvdata *drvdata)
 		spin_lock(&mgr->bl_lock);
 		list_del(&bli->list);
 		--mgr->bl_len;
+		kfree(bli);
 	}
 
 	spin_unlock(&mgr->bl_lock);