Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90254ac0 authored by Daniel Vetter's avatar Daniel Vetter Committed by Dave Airlie
Browse files

drm: fix locking in gem debugfs/procfs file



The idr is protected with our spinlock, if we don't hold that nothing
prevents the gem objects from disappearing from under us.

Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 6eb9278a
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -218,7 +218,11 @@ int drm_gem_name_info(struct seq_file *m, void *data)
	struct drm_device *dev = node->minor->dev;
	struct drm_device *dev = node->minor->dev;


	seq_printf(m, "  name     size handles refcount\n");
	seq_printf(m, "  name     size handles refcount\n");

	spin_lock(&dev->object_name_lock);
	idr_for_each(&dev->object_name_idr, drm_gem_one_name_info, m);
	idr_for_each(&dev->object_name_idr, drm_gem_one_name_info, m);
	spin_unlock(&dev->object_name_lock);

	return 0;
	return 0;
}
}