Commit dcd36c43 authored by Rob Rice's avatar Rob Rice Committed by Herbert Xu

crypto: brcm - Avoid double free in ahash_finup()

In Broadcom SPU driver, in case where incremental hash
is done in software in ahash_finup(), tmpbuf was freed
twice.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarRob Rice <rob.rice@broadcom.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent eafa2669
...@@ -2331,7 +2331,6 @@ static int ahash_finup(struct ahash_request *req) ...@@ -2331,7 +2331,6 @@ static int ahash_finup(struct ahash_request *req)
/* Call synchronous update */ /* Call synchronous update */
ret = crypto_shash_finup(ctx->shash, tmpbuf, req->nbytes, ret = crypto_shash_finup(ctx->shash, tmpbuf, req->nbytes,
req->result); req->result);
kfree(tmpbuf);
} else { } else {
/* Otherwise call the internal function which uses SPU hw */ /* Otherwise call the internal function which uses SPU hw */
return __ahash_finup(req); return __ahash_finup(req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment