summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2012-02-15 17:36:39 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-29 16:30:53 -0800
commit32818d15fe50ef5465fc635252ca4c2c1bcf1673 (patch)
tree93f4acb419207bd4b42e71be9ff4bef12d996f10 /arch
parent3c40e5e0828215d90ab4374405019cd5d170615b (diff)
ARM: 7326/2: PL330: fix null pointer dereference in pl330_chan_ctrl()
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: <1326458191-23492-1-git-send-email-mans.rullgard@linaro.org> Signed-off-by: Mans Rullgard <mans.rullgard@linaro.org> Acked-by: Javi Merino <javi.merino@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/common/pl330.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/common/pl330.c b/arch/arm/common/pl330.c
index 8d8df744f7a5..67abef5a5882 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);