linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Will Thomas <will.thomas@imgtec.com>
To: <herbert@gondor.apana.org.au>
Cc: <linux-crypto@vger.kernel.org>, Will Thomas <will.thomas@imgtec.com>
Subject: [PATCH v2 1/7] crypto: img-hash - Fix null pointer exception
Date: Fri, 5 Aug 2016 14:00:14 +0100	[thread overview]
Message-ID: <1470402020-10774-2-git-send-email-will.thomas@imgtec.com> (raw)
In-Reply-To: <1470402020-10774-1-git-send-email-will.thomas@imgtec.com>

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>
---
 drivers/crypto/img-hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c
index 68e8aa9..e5c941b 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);
-- 
2.1.4

  reply	other threads:[~2016-08-05 13:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05 13:00 [PATCH v2 0/7] crypto: img-hash - fixes and interface changes Will Thomas
2016-08-05 13:00 ` Will Thomas [this message]
2016-08-05 13:00 ` [PATCH v2 2/7] crypto: img-hash - Fix hash request context Will Thomas
2016-08-05 13:00 ` [PATCH v2 3/7] crypto: img-hash - Reconfigure DMA Burst length Will Thomas
2016-08-05 13:00 ` [PATCH v2 4/7] crypto: img-hash - Add suspend resume hooks for img hash Will Thomas
2016-08-05 13:00 ` [PATCH v2 5/7] crypto: img-hash - Add support for export and import Will Thomas
2016-08-05 13:00 ` [PATCH v2 6/7] crypto: img-hash - log a successful probe Will Thomas
2016-08-05 13:00 ` [PATCH v2 7/7] crypto: img-hash - Fix set_reqsize call Will Thomas
2016-08-09 11:02 ` [PATCH v2 0/7] crypto: img-hash - fixes and interface changes Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1470402020-10774-2-git-send-email-will.thomas@imgtec.com \
    --to=will.thomas@imgtec.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).