From c6da520a7044ac3e8c3f0fd4a191c875d55b3ea3 Mon Sep 17 00:00:00 2001 From: Lee Yongjin Date: Fri, 26 Jul 2013 17:59:04 +0900 Subject: [PATCH] dma: pl330: add guard codes for pre-released request Rarely, pl330_update() function is called for already freed request. In that case, pl330_update gets id which value is -1, then kernel panic is occurred. Change-Id: I6e426e576e2bba25891a280e8539d0c5b3dba7fe Signed-off-by: Lee Yongjin --- drivers/dma/pl330.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 1560957cf8fc..b3832ca2ee8e 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -1666,6 +1666,9 @@ static int pl330_update(struct pl330_dmac *pl330) id = pl330->events[ev]; + if (id == -1) + continue; + thrd = &pl330->channels[id]; active = thrd->req_running; -- 2.20.1