diff options
author | Javi Merino <[email protected]> | 2012-02-15 17:36:39 +0100 |
---|---|---|
committer | Russell King <[email protected]> | 2012-02-15 21:10:49 +0000 |
commit | 46e33c606af8e0caeeca374103189663d877c0d6 (patch) | |
tree | a1f97d7fd9af85b6f505c166222152192c11c1bb | |
parent | 4272f98a1ae81709fc5c804c33c044064e419cd9 (diff) |
ARM: 7326/2: PL330: fix null pointer dereference in pl330_chan_ctrl()
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: <[email protected]>
Cc: [email protected]
Signed-off-by: Mans Rullgard <[email protected]>
Acked-by: Javi Merino <[email protected]>
Signed-off-by: Russell King <[email protected]>
-rw-r--r-- | 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 d8e44a43047c..ff3ad2244824 100644 --- a/arch/arm/common/pl330.c +++ b/arch/arm/common/pl330.c @@ -1502,12 +1502,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); |