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

    drm/msm: don't deref error pointer in the msm_fbdev_create error path

to the 4.14-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-msm-don-t-deref-error-pointer-in-the-msm_fbdev_create-error-path.patch
and it can be found in the queue-4.14 subdirectory.

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


From foo@baz Sun Jun 17 12:13:49 CEST 2018
From: Emil Velikov <emil.veli...@collabora.com>
Date: Wed, 28 Mar 2018 17:22:16 +0100
Subject: drm/msm: don't deref error pointer in the msm_fbdev_create error path

From: Emil Velikov <emil.veli...@collabora.com>

[ Upstream commit 789d4c300e10eb2096ee83c3497118e67ccc951e ]

Currently the error pointer returned by msm_alloc_stolen_fb gets passed
to drm_framebuffer_remove. The latter handles only NULL pointers, thus
a nasty crash will occur.

Drop the unnecessary fail label and the associated checks - both err and
fb will be set at this stage.

Cc: Rob Clark <robdcl...@gmail.com>
Cc: linux-arm-...@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: freedr...@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.veli...@collabora.com>
Signed-off-by: Rob Clark <robdcl...@gmail.com>
Signed-off-by: Sasha Levin <alexander.le...@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/gpu/drm/msm/msm_fbdev.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

--- a/drivers/gpu/drm/msm/msm_fbdev.c
+++ b/drivers/gpu/drm/msm/msm_fbdev.c
@@ -92,8 +92,7 @@ static int msm_fbdev_create(struct drm_f
 
        if (IS_ERR(fb)) {
                dev_err(dev->dev, "failed to allocate fb\n");
-               ret = PTR_ERR(fb);
-               goto fail;
+               return PTR_ERR(fb);
        }
 
        bo = msm_framebuffer_bo(fb, 0);
@@ -151,13 +150,7 @@ static int msm_fbdev_create(struct drm_f
 
 fail_unlock:
        mutex_unlock(&dev->struct_mutex);
-fail:
-
-       if (ret) {
-               if (fb)
-                       drm_framebuffer_remove(fb);
-       }
-
+       drm_framebuffer_remove(fb);
        return ret;
 }
 


Patches currently in stable-queue which might be from 
emil.veli...@collabora.com are

queue-4.14/drm-omap-fix-possible-null-ref-issue-in-tiler_reserve_2d.patch
queue-4.14/drm-omap-fix-uninitialized-ret-variable.patch
queue-4.14/drm-msm-don-t-deref-error-pointer-in-the-msm_fbdev_create-error-path.patch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to