linux/drivers/gpu/drm/omapdrm
Nathan Chancellor c176060a4c drm: omapdrm: Do not use helper unininitialized in omap_fbdev_init()
Clang warns (or errors with CONFIG_WERROR):

  ../drivers/gpu/drm/omapdrm/omap_fbdev.c:235:6: error: variable 'helper' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
          if (!fbdev)
              ^~~~~~
  ../drivers/gpu/drm/omapdrm/omap_fbdev.c:259:26: note: uninitialized use occurs here
          drm_fb_helper_unprepare(helper);
                                  ^~~~~~
  ../drivers/gpu/drm/omapdrm/omap_fbdev.c:235:2: note: remove the 'if' if its condition is always false
          if (!fbdev)
          ^~~~~~~~~~~
  ../drivers/gpu/drm/omapdrm/omap_fbdev.c:228:30: note: initialize the variable 'helper' to silence this warning
          struct drm_fb_helper *helper;
                                      ^
                                       = NULL
  1 error generated.

Return early, as there is nothing for the function to do if memory
cannot be allocated. There is no point in adding another label to just
emit the warning at the end of the function in this case, as memory
allocation failures are already logged.

Fixes: 3fb1f62f80 ("drm/fb-helper: Remove drm_fb_helper_unprepare() from drm_fb_helper_fini()")
Link: https://github.com/ClangBuiltLinux/linux/issues/1809
Link: https://lore.kernel.org/oe-kbuild-all/202302250058.fYTe9aTP-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230224-omapdrm-wsometimes-uninitialized-v1-1-3fec8906ee3a@kernel.org
2023-02-28 09:45:42 +01:00
..
dss drm/omap: dsi: Fix excessive stack usage 2022-12-16 19:24:39 +02:00
Kconfig drm/omap: Depend on CONFIG_OF 2021-10-07 05:42:16 +03:00
Makefile drm/omap: introduce omap_hw_overlay 2021-12-08 10:04:40 +02:00
omap_crtc.c drm: Remove unnecessary include statements of drm_plane_helper.h 2022-07-26 18:42:04 +02:00
omap_crtc.h drm/omap: remove dss_mgr_ops 2020-12-15 16:17:30 +02:00
omap_debugfs.c drm: Drop drm_framebuffer.h from drm_crtc.h 2022-06-20 23:53:55 +03:00
omap_dmm_priv.h drm/omapdrm: Convert to SPDX identifier 2021-11-10 13:51:25 +02:00
omap_dmm_tiler.c drm/omap: dmm_tiler:Remove the print function dev_err() 2022-09-09 16:23:21 +03:00
omap_dmm_tiler.h drm/omapdrm: Convert to SPDX identifier 2021-11-10 13:51:25 +02:00
omap_drv.c drm/omap: stop using drm_bridge_connector_en/disable_hpd() 2023-01-05 15:08:10 +01:00
omap_drv.h drm/omap: dynamically assign hw overlays to planes 2021-12-08 10:04:47 +02:00
omap_encoder.c drm/omap: drop unused DSS next pointer 2020-12-15 16:08:26 +02:00
omap_encoder.h
omap_fb.c drm: Drop drm_blend.h from drm_crtc.h 2022-06-20 23:53:55 +03:00
omap_fb.h drm/omap: Add a 'right overlay' to plane state 2021-12-08 10:04:54 +02:00
omap_fbdev.c drm: omapdrm: Do not use helper unininitialized in omap_fbdev_init() 2023-02-28 09:45:42 +01:00
omap_fbdev.h
omap_gem_dmabuf.c drm: Assert held reservation lock for dma-buf mmapping 2022-11-11 23:49:47 +03:00
omap_gem.c drm/omap: Fix kernel docs 2023-01-17 17:57:33 +02:00
omap_gem.h drm: omapdrm: Support exporting of non-contiguous GEM BOs 2022-03-28 12:39:51 +03:00
omap_irq.c drm/omap: Fix kernel docs 2023-01-17 17:57:33 +02:00
omap_irq.h
omap_overlay.c drm: Remove unnecessary include statements of drm_plane_helper.h 2022-07-26 18:42:04 +02:00
omap_overlay.h drm/omap: Add a 'right overlay' to plane state 2021-12-08 10:04:54 +02:00
omap_plane.c drm: Remove unnecessary include statements of drm_plane_helper.h 2022-07-26 18:42:04 +02:00
omap_plane.h drm/omap: Add a 'right overlay' to plane state 2021-12-08 10:04:54 +02:00
tcm-sita.c drm/omapdrm: Convert to SPDX identifier 2021-11-10 13:51:25 +02:00
tcm.h
TODO