All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: talitos - protect against possible null ptr upon error
@ 2009-03-16  1:21 Lee Nipper
  2009-03-16  1:21 ` [PATCH 1/3] crypto: talitos - scaffolding for new algorithm types Lee Nipper
  2009-03-24 21:23 ` [PATCH] crypto: talitos - protect against possible null ptr upon error Kim Phillips
  0 siblings, 2 replies; 9+ messages in thread
From: Lee Nipper @ 2009-03-16  1:21 UTC (permalink / raw)
  To: linux-crypto; +Cc: kim.phillips, Lee Nipper

Added test for null descriptor returned from current_desc.
Also removed the diagnostic from current_desc,
and added one instead in talitos_error
to report an EU error without finding the descriptor.

Signed-off-by: Lee Nipper <lee.nipper@gmail.com>
---
 drivers/crypto/talitos.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index a3918c1..d853530 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -401,10 +401,8 @@ static struct talitos_desc *current_desc(struct device *dev, int ch)
 
 	while (priv->fifo[ch][tail].dma_desc != cur_desc) {
 		tail = (tail + 1) & (priv->fifo_len - 1);
-		if (tail == priv->tail[ch]) {
-			dev_err(dev, "couldn't locate current descriptor\n");
+		if (tail == priv->tail[ch])
 			return NULL;
-		}
 	}
 
 	return priv->fifo[ch][tail].desc;
@@ -523,8 +521,14 @@ static void talitos_error(unsigned long data, u32 isr, u32 isr_lo)
 			dev_err(dev, "illegal descriptor header error\n");
 		if (v_lo & TALITOS_CCPSR_LO_IEU)
 			dev_err(dev, "invalid execution unit error\n");
-		if (v_lo & TALITOS_CCPSR_LO_EU)
-			report_eu_error(dev, ch, current_desc(dev, ch));
+		if (v_lo & TALITOS_CCPSR_LO_EU) {
+			struct talitos_desc *desc = current_desc(dev, ch);
+			if (desc)
+				report_eu_error(dev, ch, desc);
+			else
+				dev_err(dev,
+					"EU error, but no descriptor found.\n");
+		}
 		if (v_lo & TALITOS_CCPSR_LO_GB)
 			dev_err(dev, "gather boundary error\n");
 		if (v_lo & TALITOS_CCPSR_LO_GRL)
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-03-25  4:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-16  1:21 [PATCH] crypto: talitos - protect against possible null ptr upon error Lee Nipper
2009-03-16  1:21 ` [PATCH 1/3] crypto: talitos - scaffolding for new algorithm types Lee Nipper
2009-03-16  1:21   ` [PATCH 2/3] crypto: talitos - Add ablkcipher algorithms Lee Nipper
2009-03-16  1:21     ` [PATCH 3/3] crypto: talitos - Add ahash algorithms (1st cut, digest only) Lee Nipper
2009-03-25  0:11       ` Kim Phillips
2009-03-24 23:57     ` [PATCH 2/3] crypto: talitos - Add ablkcipher algorithms Kim Phillips
2009-03-24 23:34   ` [PATCH 1/3] crypto: talitos - scaffolding for new algorithm types Kim Phillips
2009-03-24 21:23 ` [PATCH] crypto: talitos - protect against possible null ptr upon error Kim Phillips
2009-03-25  4:06   ` Lee Nipper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.