linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: pl330: fix null pointer dereference in pl330_chan_ctrl()
@ 2012-01-13 12:36 Mans Rullgard
  2012-01-13 13:02 ` Russell King - ARM Linux
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mans Rullgard @ 2012-01-13 12:36 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linaro-dev, patches, Russell King, Jassi Brar, Javi Merino,
	Lucas De Marchi, linux-kernel

This fixes the thrd->req_running field being accessed before thrd
is checked for null.  The error was introduced in abb959f.

Signed-off-by: Mans Rullgard <mans.rullgard@linaro.org>
---
 arch/arm/common/pl330.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/common/pl330.c b/arch/arm/common/pl330.c
index 8d8df74..67abef5 100644
--- a/arch/arm/common/pl330.c
+++ b/arch/arm/common/pl330.c
@@ -1496,12 +1496,13 @@ int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)
 	struct pl330_thread *thrd = ch_id;
 	struct pl330_dmac *pl330;
 	unsigned long flags;
-	int ret = 0, active = thrd->req_running;
+	int ret = 0, active;
 
 	if (!thrd || thrd->free || thrd->dmac->state == DYING)
 		return -EINVAL;
 
 	pl330 = thrd->dmac;
+	active = thrd->req_running;
 
 	spin_lock_irqsave(&pl330->lock, flags);
 
-- 
1.7.8.3


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

end of thread, other threads:[~2012-01-25 12:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-13 12:36 [PATCH] ARM: pl330: fix null pointer dereference in pl330_chan_ctrl() Mans Rullgard
2012-01-13 13:02 ` Russell King - ARM Linux
2012-01-13 13:48 ` Javi Merino
2012-01-13 19:46   ` Mans Rullgard
2012-01-14 21:53 ` Sergei Shtylyov
2012-01-25 12:11   ` [PATCH] DMA: " Mans Rullgard

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).