From: Steve Hampson <steven.t.hampson@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH] Fix NULL pointer found by static analysis
Date: Tue, 22 Sep 2020 21:40:54 -0700 [thread overview]
Message-ID: <20200923044054.5653-1-steven.t.hampson@intel.com> (raw)
A static analysis tool has reveiled a NULL pointer error in
__i915_gem_object_lock. This appears to be correct as many calls
pass a NULL into the ww parameter.
Signed-off-by: Steve Hampson <steven.t.hampson@intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_object.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h
index d46db8d8f38e..9b18ead42991 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h
@@ -126,7 +126,7 @@ static inline int __i915_gem_object_lock(struct drm_i915_gem_object *obj,
if (ret == -EALREADY)
ret = 0;
- if (ret == -EDEADLK)
+ if (ret == -EDEADLK && ww)
ww->contended = obj;
return ret;
--
2.21.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2020-09-23 4:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-23 4:40 Steve Hampson [this message]
2020-09-23 5:28 ` [Intel-gfx] ✓ Fi.CI.BAT: success for Fix NULL pointer found by static analysis Patchwork
2020-09-23 8:48 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-09-23 8:58 ` [Intel-gfx] [PATCH] " Chris Wilson
2020-09-23 9:04 ` Jani Nikula
2020-09-23 21:23 ` Hampson, Steven T
2020-09-23 21:57 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Fix NULL pointer found by static analysis (rev2) Patchwork
2020-09-23 22:22 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-09-24 1:08 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200923044054.5653-1-steven.t.hampson@intel.com \
--to=steven.t.hampson@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).