idr_for_each_entry() is fine, but will prematurely terminate on
transient NULL entries. It should be switched over to idr_for_each,
which allows you to handle this explicitly.
Note that transient NULL pointers in drm_file.object_idr have been a
thing since f6cd7daecff5 ("drm: Release driver references to handle
before making it available again"), this is a really old issue.
Since it's just a premature loop terminate the impact should be fairly
benign, at least for any debugfs or fdinfo code.
Signed-off-by: Simona Vetter <[email protected]>
Signed-off-by: Simona Vetter <[email protected]>
Cc: Zack Rusin <[email protected]>
Cc: Broadcom internal kernel review list <[email protected]>
---
drivers/gpu/drm/vmwgfx/vmwgfx_gem.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
index c55382167c1b..438e40b92281 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gem.c
@@ -323,6 +323,7 @@ static int vmw_debugfs_gem_info_show(struct seq_file *m,
void *unused)
rcu_read_unlock();
spin_lock(&file->table_lock);
+ /* FIXME: Use idr_for_each to handle transient NULL pointers */
idr_for_each_entry(&file->object_idr, gobj, id) {
struct vmw_bo *bo = to_vmw_bo(gobj);
--
2.49.0