[PATCH 2/2] drm/v3d: assure that the job is NULL after being freed

Maíra Canal mcanal at igalia.com
Mon Oct 23 10:58:34 UTC 2023


After the job is finished and freed, we need to make sure that the job is
NULL. Otherwise, we would get a warning when unloading the driver, as it
would look like the job still exists. Therefore, after freeing the job,
let's assign it to NULL in order to indicate that the job has finished.

Signed-off-by: Maíra Canal <mcanal at igalia.com>
---
 drivers/gpu/drm/v3d/v3d_gem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index afa7d170d1ff..61a7f36fc8e2 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -333,6 +333,7 @@ v3d_job_free(struct kref *ref)
 		v3d_perfmon_put(job->perfmon);

 	kfree(job);
+	job = NULL;
 }

 static void
--
2.41.0



More information about the dri-devel mailing list