1
linux/drivers/gpu/drm/mediatek
Dan Carpenter 4018651ba5 drm/mediatek: Fix potential NULL dereference in mtk_crtc_destroy()
In mtk_crtc_create(), if the call to mbox_request_channel() fails then we
set the "mtk_crtc->cmdq_client.chan" pointer to NULL.  In that situation,
we do not call cmdq_pkt_create().

During the cleanup, we need to check if the "mtk_crtc->cmdq_client.chan"
is NULL first before calling cmdq_pkt_destroy().  Calling
cmdq_pkt_destroy() is unnecessary if we didn't call cmdq_pkt_create() and
it will result in a NULL pointer dereference.

Fixes: 7627122fd1 ("drm/mediatek: Add cmdq_handle in mtk_crtc")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/cc537bd6-837f-4c85-a37b-1a007e268310@stanley.mountain/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
2024-10-23 14:09:13 +00:00
..
Kconfig drm/bridge-connector: move to DRM_DISPLAY_HELPER module 2024-09-03 10:18:31 +02:00
Makefile drm/mediatek: Rename files "mtk_drm_gem.c" to "mtk_gem.c" 2024-04-01 15:35:43 +00:00
mtk_cec.c drm/mediatek: Log errors in probe with dev_err_probe() 2024-06-27 14:03:49 +00:00
mtk_cec.h
mtk_crtc.c drm/mediatek: Fix potential NULL dereference in mtk_crtc_destroy() 2024-10-23 14:09:13 +00:00
mtk_crtc.h drm/mediatek: Rename files "mtk_drm_plane.h" to "mtk_plane.h" 2024-04-01 15:30:26 +00:00
mtk_ddp_comp.c drm/mediatek: Add blend_modes to mtk_plane_init() for different SoCs 2024-10-22 12:47:47 +00:00
mtk_ddp_comp.h drm/mediatek: Add blend_modes to mtk_plane_init() for different SoCs 2024-10-22 12:47:47 +00:00
mtk_disp_aal.c drm/mediatek: Log errors in probe with dev_err_probe() 2024-06-27 14:03:49 +00:00
mtk_disp_ccorr.c drm/mediatek: Log errors in probe with dev_err_probe() 2024-06-27 14:03:49 +00:00
mtk_disp_color.c drm/mediatek: Log errors in probe with dev_err_probe() 2024-06-27 14:03:49 +00:00
mtk_disp_drv.h drm/mediatek: Add blend_modes to mtk_plane_init() for different SoCs 2024-10-22 12:47:47 +00:00
mtk_disp_gamma.c drm/mediatek: Log errors in probe with dev_err_probe() 2024-06-27 14:03:49 +00:00
mtk_disp_merge.c drm/mediatek: Log errors in probe with dev_err_probe() 2024-06-27 14:03:49 +00:00
mtk_disp_ovl_adaptor.c drm/mediatek: Add blend_modes to mtk_plane_init() for different SoCs 2024-10-22 12:47:47 +00:00
mtk_disp_ovl.c drm/mediatek: Fix color format MACROs in OVL 2024-10-22 12:50:51 +00:00
mtk_disp_rdma.c drm/mediatek: Drop unnecessary check for property presence 2024-08-29 14:26:14 +00:00
mtk_dp_reg.h
mtk_dp.c drm/mediatek: Fix get efuse issue for MT8188 DPTX 2024-10-23 14:00:56 +00:00
mtk_dpi_regs.h
mtk_dpi.c drm/mediatek: dpi/dsi: Fix possible_crtcs calculation 2024-06-28 12:25:18 +00:00
mtk_drm_drv.c dma-mapping: don't return errors from dma_set_max_seg_size 2024-08-29 07:22:49 +03:00
mtk_drm_drv.h drm/mediatek: Set DRM mode configs accordingly 2024-06-20 13:57:36 +00:00
mtk_dsi.c drm/mediatek: dsi: Add dsi per-frame lp code for mt8188 2024-08-29 14:27:09 +00:00
mtk_ethdr.c drm/mediatek: Add blend_modes to mtk_plane_init() for different SoCs 2024-10-22 12:47:47 +00:00
mtk_ethdr.h drm/mediatek: Add blend_modes to mtk_plane_init() for different SoCs 2024-10-22 12:47:47 +00:00
mtk_gem.c The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
mtk_gem.h drm/mediatek: Rename files "mtk_drm_gem.h" to "mtk_gem.h" 2024-04-01 15:33:52 +00:00
mtk_hdmi_ddc.c drm/mediatek: Log errors in probe with dev_err_probe() 2024-06-27 14:03:49 +00:00
mtk_hdmi_regs.h
mtk_hdmi.c drm/mediatek: Log errors in probe with dev_err_probe() 2024-06-27 14:03:49 +00:00
mtk_hdmi.h
mtk_mdp_rdma.c drm/mediatek: Log errors in probe with dev_err_probe() 2024-06-27 14:03:49 +00:00
mtk_mdp_rdma.h
mtk_padding.c drm/mediatek: Log errors in probe with dev_err_probe() 2024-06-27 14:03:49 +00:00
mtk_plane.c drm/mediatek: Add blend_modes to mtk_plane_init() for different SoCs 2024-10-22 12:47:47 +00:00
mtk_plane.h drm/mediatek: Add blend_modes to mtk_plane_init() for different SoCs 2024-10-22 12:47:47 +00:00