diff mbox series

drm/sched: Fix static checker warning for potential NULL ptr

Message ID 1558533443-7795-1-git-send-email-andrey.grodzovsky@amd.com (mailing list archive)
State New, archived
Headers show
Series drm/sched: Fix static checker warning for potential NULL ptr | expand

Commit Message

Andrey Grodzovsky May 22, 2019, 1:57 p.m. UTC
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
---
 drivers/gpu/drm/scheduler/sched_main.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

Comments

Christian König May 22, 2019, 2:08 p.m. UTC | #1
Am 22.05.19 um 15:57 schrieb Andrey Grodzovsky:
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/scheduler/sched_main.c | 17 +++++++++--------
>   1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> index 90d7a82..ec7faca 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -286,16 +286,17 @@ static void drm_sched_job_timedout(struct work_struct *work)
>   	job = list_first_entry_or_null(&sched->ring_mirror_list,
>   				       struct drm_sched_job, node);
>   
> -	if (job)
> +	if (job) {
>   		job->sched->ops->timedout_job(job);
>   
> -	/*
> -	 * Guilty job did complete and hence needs to be manually removed
> -	 * See drm_sched_stop doc.
> -	 */
> -	if (sched->free_guilty) {
> -		job->sched->ops->free_job(job);
> -		sched->free_guilty = false;
> +		/*
> +		 * Guilty job did complete and hence needs to be manually removed
> +		 * See drm_sched_stop doc.
> +		 */
> +		if (sched->free_guilty) {
> +			job->sched->ops->free_job(job);
> +			sched->free_guilty = false;
> +		}
>   	}
>   
>   	spin_lock_irqsave(&sched->job_list_lock, flags);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index 90d7a82..ec7faca 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -286,16 +286,17 @@  static void drm_sched_job_timedout(struct work_struct *work)
 	job = list_first_entry_or_null(&sched->ring_mirror_list,
 				       struct drm_sched_job, node);
 
-	if (job)
+	if (job) {
 		job->sched->ops->timedout_job(job);
 
-	/*
-	 * Guilty job did complete and hence needs to be manually removed
-	 * See drm_sched_stop doc.
-	 */
-	if (sched->free_guilty) {
-		job->sched->ops->free_job(job);
-		sched->free_guilty = false;
+		/*
+		 * Guilty job did complete and hence needs to be manually removed
+		 * See drm_sched_stop doc.
+		 */
+		if (sched->free_guilty) {
+			job->sched->ops->free_job(job);
+			sched->free_guilty = false;
+		}
 	}
 
 	spin_lock_irqsave(&sched->job_list_lock, flags);