Skip to content

Commit 796762f

Browse files
Thomas Zimmermannrobclark
authored andcommitted
drm/msm: Fix possible uninitialized access in fbdev
Do not run drm_fb_helper_unprepare() if fbdev allocation fails. Avoids access to an uninitialized pointer. Original bug report is at [1]. Reported-by: kernel test robot <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Fixes: 3fb1f62 ("drm/fb-helper: Remove drm_fb_helper_unprepare() from drm_fb_helper_fini()") Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/ # 1 Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/523715/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Clark <[email protected]>
1 parent 8a86f21 commit 796762f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/msm/msm_fbdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@ static const struct drm_fb_helper_funcs msm_fb_helper_funcs = {
136136
struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev)
137137
{
138138
struct msm_drm_private *priv = dev->dev_private;
139-
struct msm_fbdev *fbdev = NULL;
139+
struct msm_fbdev *fbdev;
140140
struct drm_fb_helper *helper;
141141
int ret;
142142

143143
fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL);
144144
if (!fbdev)
145-
goto fail;
145+
return NULL;
146146

147147
helper = &fbdev->base;
148148

0 commit comments

Comments
 (0)