drm/msm: Fix possible uninitialized access in fbdev
PATCH 1/1 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].
--- drivers/gpu/drm/msm/msm_fbdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/msm_fbdev.c +2 -2
@@ -136,13 +136,13 @@ static const struct drm_fb_helper_funcs msm_fb_helper_funcs = {struct drm_fb_helper *msm_fbdev_init (struct drm_device *dev) {struct msm_drm_private *priv = dev->dev_private; -struct msm_fbdev *fbdev =NULL ; +struct msm_fbdev *fbdev;struct drm_fb_helper *helper;int ret; fbdev =kzalloc (sizeof (*fbdev),GFP_KERNEL );if (!fbdev) - goto fail; +return NULL ; helper = &fbdev->base;
Signature · 1 line
2.39.2
Quoted 10 lines · Thomas Zimmermann
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 3fb1f62f80a1 ("drm/fb-helper: Remove drm_fb_helper_unprepare() from drm_fb_helper_fini()")--- drivers/gpu/drm/msm/msm_fbdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Hi
Am 22.02.23 um 13:37 schrieb Dmitry Baryshkov:
Quoted 12 lines · Thomas Zimmermann
Quoted 10 lines
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 3fb1f62f80a1 ("drm/fb-helper: Remove drm_fb_helper_unprepare() from drm_fb_helper_fini()")---
drivers/gpu/drm/msm/msm_fbdev.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 2 lines
Reviewed-by Dmitry Baryshkov <[email protected]>
Impressive response time. Thanks a lot.
Best regards
Thomas
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev
Quoted 10 lines · Thomas Zimmermann
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 3fb1f62f80a1 ("drm/fb-helper: Remove drm_fb_helper_unprepare() from drm_fb_helper_fini()")--- drivers/gpu/drm/msm/msm_fbdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)