Skip to contentSkip to conversation

Patch "drm/msm: don't deref error pointer in the msm_fbdev_create error path" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Jun 17, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author Applied
#0 lore raw

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 <[email protected]> know about it.

From foo@baz Sun Jun 17 12:13:49 CEST 2018
From: Emil Velikov <[email protected]>
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 <[email protected]>

[ 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.

---
 drivers/gpu/drm/msm/msm_fbdev.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/gpu/drm/msm/msm_fbdev.c +2 -9
@@ -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 [email protected] 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
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno