]> Pileus Git - ~andy/linux/commitdiff
crypto: ahash - Fully restore ahash request before completing
authorMarek Vasut <marex@denx.de>
Tue, 10 Dec 2013 19:26:19 +0000 (20:26 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 5 Jan 2014 12:49:51 +0000 (20:49 +0800)
When finishing the ahash request, the ahash_op_unaligned_done() will
call complete() on the request. Yet, this will not call the correct
complete callback. The correct complete callback was previously stored
in the requests' private data, as seen in ahash_op_unaligned(). This
patch restores the correct complete callback and .data field of the
request before calling complete() on it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/ahash.c

index 793a27f2493e5287c1275df40feaca7b7b14c87e..a92dc382f7813eb2d8e3c7354e126c1987fedb0d 100644 (file)
@@ -213,7 +213,10 @@ static void ahash_op_unaligned_done(struct crypto_async_request *req, int err)
 
        ahash_op_unaligned_finish(areq, err);
 
-       complete(data, err);
+       areq->base.complete = complete;
+       areq->base.data = data;
+
+       complete(&areq->base, err);
 }
 
 static int ahash_op_unaligned(struct ahash_request *req,