From: Dan Carpenter <dan.carpenter@linaro.org>
To: Nirmoy Das <nirmoy.das@intel.com>
Cc: intel-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org,
Suren Baghdasaryan <surenb@google.com>,
Matthew Auld <matthew.auld@intel.com>,
Daniel Vetter <daniel@ffwll.ch>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
David Airlie <airlied@gmail.com>
Subject: [Intel-gfx] [PATCH] drm/i915: Fix a NULL vs IS_ERR() bug
Date: Tue, 6 Jun 2023 11:23:56 +0300 [thread overview]
Message-ID: <ZH7tHLRZ9oBjedjN@moroto> (raw)
The mmap_offset_attach() function returns error pointers, it doesn't
return NULL.
Fixes: eaee1c085863 ("drm/i915: Add a function to mmap framebuffer obj")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/gpu/drm/i915/gem/i915_gem_mman.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index 4e7a838ab7bd..aa4d842d4c5a 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -1085,8 +1085,8 @@ int i915_gem_fb_mmap(struct drm_i915_gem_object *obj, struct vm_area_struct *vma
/* handle stolen and smem objects */
mmap_type = i915_ggtt_has_aperture(ggtt) ? I915_MMAP_TYPE_GTT : I915_MMAP_TYPE_WC;
mmo = mmap_offset_attach(obj, mmap_type, NULL);
- if (!mmo)
- return -ENODEV;
+ if (IS_ERR(mmo))
+ return PTR_ERR(mmo);
}
/*
--
2.39.2
next reply other threads:[~2023-06-06 8:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 8:23 Dan Carpenter [this message]
2023-06-06 8:51 ` [Intel-gfx] [PATCH] drm/i915: Fix a NULL vs IS_ERR() bug Nirmoy Das
2023-06-06 9:22 ` Andi Shyti
2023-06-19 14:06 ` Nirmoy Das
2023-06-06 12:23 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-06-07 2:25 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=ZH7tHLRZ9oBjedjN@moroto \
--to=dan.carpenter@linaro.org \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=matthew.auld@intel.com \
--cc=nirmoy.das@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=surenb@google.com \
/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