All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: ccp - release hmac_buf if ccp_run_sha_cmd fails
@ 2019-09-13 23:48 Navid Emamdoost
  2019-09-16 13:22 ` Lendacky, Thomas
  0 siblings, 1 reply; 6+ messages in thread
From: Navid Emamdoost @ 2019-09-13 23:48 UTC (permalink / raw)
  Cc: emamd001, smccaman, kjlu, Navid Emamdoost, Tom Lendacky,
	Gary Hook, Herbert Xu, David S. Miller, linux-crypto,
	linux-kernel

In ccp_run_sha_cmd, if the type of sha is invalid, the allocated
hmac_buf should be released.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 drivers/crypto/ccp/ccp-ops.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
index 9bc3c62157d7..cff16f0cc15b 100644
--- a/drivers/crypto/ccp/ccp-ops.c
+++ b/drivers/crypto/ccp/ccp-ops.c
@@ -1782,6 +1782,7 @@ static int ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
 			       LSB_ITEM_SIZE);
 			break;
 		default:
+			kfree(hmac_buf);
 			ret = -EINVAL;
 			goto e_ctx;
 		}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-04 15:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13 23:48 [PATCH] crypto: ccp - release hmac_buf if ccp_run_sha_cmd fails Navid Emamdoost
2019-09-16 13:22 ` Lendacky, Thomas
2019-09-19 13:29   ` Gary R Hook
2019-09-19 16:04     ` [PATCH v2] crypto: ccp - Release all allocated memory if sha type is invalid Navid Emamdoost
2019-09-19 17:00       ` Gary R Hook
2019-10-04 15:44       ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.