[Intel-gfx] [bug report] drm/i915: Trim struct_mutex hold duration for i915_gem_free_objects

Chris Wilson chris at chris-wilson.co.uk
Thu May 30 08:19:08 UTC 2019


Quoting Dan Carpenter (2019-05-30 09:13:01)
> Hello Chris Wilson,
> 
> The patch cc731f5a3b1f: "drm/i915: Trim struct_mutex hold duration
> for i915_gem_free_objects" from Oct 13, 2017, leads to the following
> static checker warning:
> 
>         drivers/gpu/drm/i915/gem/i915_gem_object.c:195 __i915_gem_free_objects()
>         error: we previously assumed 'obj' could be null (see line 195)
> 
> drivers/gpu/drm/i915/gem/i915_gem_object.c
>    188  static void __i915_gem_free_objects(struct drm_i915_private *i915,
>    189                                      struct llist_node *freed)
>    190  {
>    191          struct drm_i915_gem_object *obj, *on;
>    192          intel_wakeref_t wakeref;
>    193  
>    194          wakeref = intel_runtime_pm_get(i915);
>    195          llist_for_each_entry_safe(obj, on, freed, freed) {
>                                                ^^
> &on->freed is a pointer to the next item in the list?

Hmm. I was looking at llist_for_each_safe where the next pointer would be
NULL. But for _entry, it will indeed be offset.
-Chris


More information about the Intel-gfx mailing list