Commit 46e33c60 authored by Javi Merino's avatar Javi Merino Committed by Russell King

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

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

Reference: <1326458191-23492-1-git-send-email-mans.rullgard@linaro.org>

Cc: stable@kernel.org
Signed-off-by: default avatarMans Rullgard <mans.rullgard@linaro.org>
Acked-by: default avatarJavi Merino <javi.merino@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 4272f98a
...@@ -1502,12 +1502,13 @@ int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op) ...@@ -1502,12 +1502,13 @@ int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)
struct pl330_thread *thrd = ch_id; struct pl330_thread *thrd = ch_id;
struct pl330_dmac *pl330; struct pl330_dmac *pl330;
unsigned long flags; unsigned long flags;
int ret = 0, active = thrd->req_running; int ret = 0, active;
if (!thrd || thrd->free || thrd->dmac->state == DYING) if (!thrd || thrd->free || thrd->dmac->state == DYING)
return -EINVAL; return -EINVAL;
pl330 = thrd->dmac; pl330 = thrd->dmac;
active = thrd->req_running;
spin_lock_irqsave(&pl330->lock, flags); spin_lock_irqsave(&pl330->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment