[PATCH] drm/syncobj: reset file ptr to NULL when released.

Dave Airlie airlied at gmail.com
Tue Dec 19 11:30:12 UTC 2017

From: Dave Airlie <airlied at redhat.com>

The vk cts test:

triggers a lot of
VFS: Close: file count is 0

This patch fixes it, but I'm guessing it's racy and someone will
smell rcu, but I just wanted to send out the proof of fixing it
so I remember.

Signed-off-by: Dave Airlie <airlied at redhat.com>
 drivers/gpu/drm/drm_syncobj.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index f776fc1cc543..ffa5bbd75852 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -361,6 +361,7 @@ static int drm_syncobj_file_release(struct inode *inode, struct file *file)
 	struct drm_syncobj *syncobj = file->private_data;
+	syncobj->file = NULL;
 	return 0;

More information about the dri-devel mailing list