diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2023-02-22 13:37:12 +0100 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2023-02-22 11:22:03 -0800 |
commit | 796762f0506077c4f048b4eb05de2f587f488bce (patch) | |
tree | 6d70a9e3d73772a57e3aa9d58bc699df2758a2cc /drivers | |
parent | 8a86f213f4426f19511a16d886871805b35c3acf (diff) | |
download | linux-stable-796762f0506077c4f048b4eb05de2f587f488bce.tar.gz linux-stable-796762f0506077c4f048b4eb05de2f587f488bce.tar.bz2 linux-stable-796762f0506077c4f048b4eb05de2f587f488bce.zip |
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 <lkp@intel.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 3fb1f62f80a1 ("drm/fb-helper: Remove drm_fb_helper_unprepare() from drm_fb_helper_fini()")
Link: https://lore.kernel.org/oe-kbuild-all/202302220810.9dymwCQ8-lkp@intel.com/ # 1
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/523715/
Link: https://lore.kernel.org/r/20230222123712.5049-1-tzimmermann@suse.de
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/msm/msm_fbdev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/msm_fbdev.c b/drivers/gpu/drm/msm/msm_fbdev.c index 31e1e30cb52a..dd7d0b965f85 100644 --- a/drivers/gpu/drm/msm/msm_fbdev.c +++ b/drivers/gpu/drm/msm/msm_fbdev.c @@ -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; |