Patch "drm/i915: Fix a NULL vs IS_ERR() bug" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/i915: Fix a NULL vs IS_ERR() bug

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-i915-fix-a-null-vs-is_err-bug.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e5b4665e0bdcdc0b79010bc0ff2b98155e44a811
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Tue Jun 6 11:23:56 2023 +0300

    drm/i915: Fix a NULL vs IS_ERR() bug
    
    [ Upstream commit 3a89311387cde27da8e290458b2d037133c1f7b5 ]
    
    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@xxxxxxxxxx>
    Reviewed-by: Nirmoy Das <nirmoy.das@xxxxxxxxx>
    Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxxxxxxx>
    Signed-off-by: Nirmoy Das <nirmoy.das@xxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/ZH7tHLRZ9oBjedjN@moroto
    Stable-dep-of: 1ac5167b3a90 ("drm/i915/gem: Adjust vma offset for framebuffer mmap offset")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index 180b66f6193cb..4a291d29c5af5 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -1118,8 +1118,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);
 	}
 
 	/*




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux