hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/crypto/img-hash.c
....@@ -357,12 +357,16 @@
357357 static void img_hash_dma_task(unsigned long d)
358358 {
359359 struct img_hash_dev *hdev = (struct img_hash_dev *)d;
360
- struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req);
360
+ struct img_hash_request_ctx *ctx;
361361 u8 *addr;
362362 size_t nbytes, bleft, wsend, len, tbc;
363363 struct scatterlist tsg;
364364
365
- if (!hdev->req || !ctx->sg)
365
+ if (!hdev->req)
366
+ return;
367
+
368
+ ctx = ahash_request_ctx(hdev->req);
369
+ if (!ctx->sg)
366370 return;
367371
368372 addr = sg_virt(ctx->sg);