Skip to content

Commit 274d4b9

Browse files
Dan Carpentertursulin
authored andcommitted
drm/i915: Fix a NULL vs IS_ERR() bug
The mmap_offset_attach() function returns error pointers, it doesn't return NULL. Fixes: eaee1c0 ("drm/i915: Add a function to mmap framebuffer obj") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Nirmoy Das <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/ZH7tHLRZ9oBjedjN@moroto (cherry picked from commit 3a89311) Signed-off-by: Tvrtko Ursulin <[email protected]>
1 parent d57ba09 commit 274d4b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/i915/gem/i915_gem_mman.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,8 @@ int i915_gem_fb_mmap(struct drm_i915_gem_object *obj, struct vm_area_struct *vma
10851085
/* handle stolen and smem objects */
10861086
mmap_type = i915_ggtt_has_aperture(ggtt) ? I915_MMAP_TYPE_GTT : I915_MMAP_TYPE_WC;
10871087
mmo = mmap_offset_attach(obj, mmap_type, NULL);
1088-
if (!mmo)
1089-
return -ENODEV;
1088+
if (IS_ERR(mmo))
1089+
return PTR_ERR(mmo);
10901090
}
10911091

10921092
/*

0 commit comments

Comments
 (0)