Thread (77 messages) 77 messages, 4 authors, 2012-02-28

[ 12/72] ARM: 7326/2: PL330: fix null pointer dereference in pl330_chan_ctrl()

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2012-02-28 01:08:32
Also in: lkml

3.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Javi Merino <redacted>

commit 46e33c606af8e0caeeca374103189663d877c0d6 upstream.

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

   abb959f: ARM: 7237/1: PL330: Fix driver freeze

Reference: [off-list ref]

Signed-off-by: Mans Rullgard <redacted>
Acked-by: Javi Merino <redacted>
Signed-off-by: Russell King <redacted>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm/common/pl330.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--- a/arch/arm/common/pl330.c
+++ b/arch/arm/common/pl330.c
@@ -1496,12 +1496,13 @@ int pl330_chan_ctrl(void *ch_id, enum pl
 	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);
 

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help