All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [bug report] drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2.
@ 2020-09-11 11:34 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-09-11 11:34 UTC (permalink / raw)
  To: maarten.lankhorst; +Cc: intel-gfx

Hello Maarten Lankhorst,

This is a semi-automatic email about new static checker warnings.

The patch 80f0b679d6f0: "drm/i915: Add an implementation for
i915_gem_ww_ctx locking, v2." from Aug 19, 2020, leads to the
following Smatch complaint:

    drivers/gpu/drm/i915/gem/i915_gem_object.h:130 __i915_gem_object_lock()
    error: we previously assumed 'ww' could be null (see line 122)

drivers/gpu/drm/i915/gem/i915_gem_object.h
   113  static inline int __i915_gem_object_lock(struct drm_i915_gem_object *obj,
   114                                           struct i915_gem_ww_ctx *ww,
   115                                           bool intr)
   116  {
   117          int ret;
   118  
   119          if (intr)
   120                  ret = dma_resv_lock_interruptible(obj->base.resv, ww ? &ww->ctx : NULL);
                                                                          ^^^^^^^^^^^^^
   121		else
   122			ret = dma_resv_lock(obj->base.resv, ww ? &ww->ctx : NULL);
                                                            ^^^^^^^^^^^^
Checks for NULL.

   123	
   124		if (!ret && ww)
   125			list_add_tail(&obj->obj_link, &ww->obj_list);
   126		if (ret == -EALREADY)
   127			ret = 0;
   128	
   129		if (ret == -EDEADLK)
   130			ww->contended = obj;
                        ^^^^^^^^^^^^^
Unchecked dereference.

   131	
   132		return ret;

regards,
dan carpenter
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-11 11:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-11 11:34 [Intel-gfx] [bug report] drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2 Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.