diff options
Diffstat (limited to 'drivers/crypto/img-hash.c')
-rw-r--r-- | drivers/crypto/img-hash.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c index b87000a0a..f70923643 100644 --- a/drivers/crypto/img-hash.c +++ b/drivers/crypto/img-hash.c @@ -359,12 +359,16 @@ static int img_hash_dma_init(struct img_hash_dev *hdev) static void img_hash_dma_task(unsigned long d) { struct img_hash_dev *hdev = (struct img_hash_dev *)d; - struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req); + struct img_hash_request_ctx *ctx; u8 *addr; size_t nbytes, bleft, wsend, len, tbc; struct scatterlist tsg; - if (!hdev->req || !ctx->sg) + if (!hdev->req) + return; + + ctx = ahash_request_ctx(hdev->req); + if (!ctx->sg) return; addr = sg_virt(ctx->sg); |