]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
crypto: img-hash - Fix null pointer exception
authorWill Thomas <will.thomas@imgtec.com>
Fri, 5 Aug 2016 13:00:14 +0000 (14:00 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 9 Aug 2016 10:47:19 +0000 (18:47 +0800)
Sporadic null pointer exceptions came from here. Fix them.

Signed-off-by: Will Thomas <will.thomas@imgtec.com>
Reviewed-by: James Hartley <james.hartley@imgtec.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/img-hash.c

index 68e8aa90fe01cbc074d70df5d5262b70834567d5..e5c941bdc6933125bd841f73a79e048910f8fd6c 100644 (file)
@@ -361,7 +361,7 @@ static void img_hash_dma_task(unsigned long d)
        size_t nbytes, bleft, wsend, len, tbc;
        struct scatterlist tsg;
 
-       if (!ctx->sg)
+       if (!hdev->req || !ctx->sg)
                return;
 
        addr = sg_virt(ctx->sg);