crypto: picoxcell - fix possible invalid pointer dereference
Jamie Iles [Tue, 2 Aug 2011 10:29:06 +0000 (11:29 +0100)]
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 017340c..a2b553e 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);
        }
 }