crypto: picoxcell - fix possible invalid pointer dereference
authorJamie Iles <jamie@jamieiles.com>
Tue, 2 Aug 2011 10:29:06 +0000 (11:29 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 10 Aug 2011 11:00:27 +0000 (19:00 +0800)
The completion callback will free the request so we must remove it from
the completion list before calling the callback.

Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/picoxcell_crypto.c

index 017340c3b715126541f5126762aee470136be538..a2b553eabbdb6db38839ba1f14cc26a61edb31d2 100644 (file)
@@ -1242,8 +1242,8 @@ static void spacc_spacc_complete(unsigned long data)
        spin_unlock_irqrestore(&engine->hw_lock, flags);
 
        list_for_each_entry_safe(req, tmp, &completed, list) {
-               req->complete(req);
                list_del(&req->list);
+               req->complete(req);
        }
 }