dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/sched: Fix static checker warning for potential NULL ptr
@ 2019-05-22 13:57 Andrey Grodzovsky
       [not found] ` <1558533443-7795-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Grodzovsky @ 2019-05-22 13:57 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA,
	ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w
  Cc: Andrey Grodzovsky

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@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);
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/sched: Fix static checker warning for potential NULL ptr
       [not found] ` <1558533443-7795-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
@ 2019-05-22 14:08   ` Christian König
  0 siblings, 0 replies; 2+ messages in thread
From: Christian König @ 2019-05-22 14:08 UTC (permalink / raw)
  To: Andrey Grodzovsky, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA

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);

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-22 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22 13:57 [PATCH] drm/sched: Fix static checker warning for potential NULL ptr Andrey Grodzovsky
     [not found] ` <1558533443-7795-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2019-05-22 14:08   ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).