From: Will Thomas Date: Fri, 5 Aug 2016 13:00:14 +0000 (+0100) Subject: crypto: img-hash - Fix null pointer exception X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~9221^2~121 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=10badea259fab2ec91a5e6bf1e568a01e4cb5263;p=mirror_ubuntu-focal-kernel.git crypto: img-hash - Fix null pointer exception Sporadic null pointer exceptions came from here. Fix them. Signed-off-by: Will Thomas Reviewed-by: James Hartley Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c index 68e8aa90fe01..e5c941bdc693 100644 --- a/drivers/crypto/img-hash.c +++ b/drivers/crypto/img-hash.c @@ -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);