lkml.org 
[lkml]   [2012]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] DMA: pl330: fix null pointer dereference in pl330_chan_ctrl()
Date
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).

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

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index add07e0..6278443 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -1568,12 +1568,13 @@ static 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.4


\
 
 \ /
  Last update: 2012-01-25 13:13    [W:0.416 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site