瀏覽代碼

crypto: img-hash - Fix null pointer exception

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>
Will Thomas 9 年之前
父節點
當前提交
10badea259
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/crypto/img-hash.c

+ 1 - 1
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);