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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Rob Rice <rob.rice@broadcom.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
eafa26696a
commit
dcd36c436c
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue