From 0a26d3be41c606a1f06286cd98bc2d9d9c909ea9 Mon Sep 17 00:00:00 2001 From: Jian Cao Date: Fri, 7 Dec 2018 17:52:12 +0800 Subject: [PATCH] osd: fix ge2d coverity error [1/1] PD#SWPL-2798 Problem: fix ge2d coverity error Solution: add return val timeout for waiting completion Verify: verified on P212 Change-Id: Iaacf3f5b30721eb5d72d3c355f0404f4848969b5 Signed-off-by: Jian Cao --- drivers/amlogic/media/common/ge2d/ge2d_wq.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/amlogic/media/common/ge2d/ge2d_wq.c b/drivers/amlogic/media/common/ge2d/ge2d_wq.c index ac4761a7..a35947d 100644 --- a/drivers/amlogic/media/common/ge2d/ge2d_wq.c +++ b/drivers/amlogic/media/common/ge2d/ge2d_wq.c @@ -1858,7 +1858,7 @@ int destroy_ge2d_work_queue(struct ge2d_context_s *ge2d_work_queue) { struct ge2d_queue_item_s *pitem, *tmp; struct list_head *head; - int empty; + int empty, timeout = 0; if (ge2d_work_queue) { /* first detatch it from the process queue,then delete it . */ @@ -1870,9 +1870,11 @@ int destroy_ge2d_work_queue(struct ge2d_context_s *ge2d_work_queue) if ((ge2d_manager.current_wq == ge2d_work_queue) && (ge2d_manager.ge2d_state == GE2D_STATE_RUNNING)) { ge2d_work_queue->ge2d_request_exit = 1; - wait_for_completion_timeout( - &ge2d_manager.event.process_complete, - msecs_to_jiffies(500)); + timeout = wait_for_completion_timeout( + &ge2d_manager.event.process_complete, + msecs_to_jiffies(500)); + if (!timeout) + ge2d_log_err("wait timeout\n"); /* condition so complex ,simplify it . */ ge2d_manager.last_wq = NULL; } /* else we can delete it safely. */ -- 2.7.4