From: Rob Rice Date: Tue, 14 Feb 2017 17:45:52 +0000 (-0500) Subject: crypto: brcm - Avoid double free in ahash_finup() X-Git-Tag: v4.11-rc1~96^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dcd36c436c9c1c5052be6bc2a9200e4e6dfbd267;p=karo-tx-linux.git 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 Signed-off-by: Rob Rice Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index a654a01ff2ba..cc0d5b98006e 100644 --- a/drivers/crypto/bcm/cipher.c +++ b/drivers/crypto/bcm/cipher.c @@ -2331,7 +2331,6 @@ static int ahash_finup(struct ahash_request *req) /* Call synchronous update */ ret = crypto_shash_finup(ctx->shash, tmpbuf, req->nbytes, req->result); - kfree(tmpbuf); } else { /* Otherwise call the internal function which uses SPU hw */ return __ahash_finup(req);