mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
stating: ccree: revert "staging: ccree: fix leak of import() after init()"
commit293edc27f8upstream This reverts commitc5f39d0786("staging: ccree: fix leak of import() after init()") and commitaece090244("staging: ccree: Uninitialized return in ssi_ahash_import()"). This is the wrong solution and ends up relying on uninitialized memory, although it was not obvious to me at the time. 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
56dbdae0c4
commit
83b4ccf2ae
@@ -1781,7 +1781,7 @@ static int ssi_ahash_import(struct ahash_request *req, const void *in)
|
||||
struct device *dev = &ctx->drvdata->plat_dev->dev;
|
||||
struct ahash_req_ctx *state = ahash_request_ctx(req);
|
||||
u32 tmp;
|
||||
int rc = 0;
|
||||
int rc;
|
||||
|
||||
memcpy(&tmp, in, sizeof(u32));
|
||||
if (tmp != CC_EXPORT_MAGIC) {
|
||||
@@ -1790,12 +1790,9 @@ static int ssi_ahash_import(struct ahash_request *req, const void *in)
|
||||
}
|
||||
in += sizeof(u32);
|
||||
|
||||
/* call init() to allocate bufs if the user hasn't */
|
||||
if (!state->digest_buff) {
|
||||
rc = ssi_hash_init(state, ctx);
|
||||
if (rc)
|
||||
goto out;
|
||||
}
|
||||
rc = ssi_hash_init(state, ctx);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
dma_sync_single_for_cpu(dev, state->digest_buff_dma_addr,
|
||||
ctx->inter_digestsize, DMA_BIDIRECTIONAL);
|
||||
|
||||
Reference in New Issue
Block a user