diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2024-09-12 11:44:59 +0300 |
---|---|---|
committer | Chun-Kuang Hu <chunkuang.hu@kernel.org> | 2024-10-23 14:09:13 +0000 |
commit | 4018651ba5c409034149f297d3dd3328b91561fd (patch) | |
tree | 60f55936f8b09c9c088fda82f5f3a7c9655acd79 /drivers/soc/imx | |
parent | 3ded11b5c1b476f6d027d9017aa7deb8ab381ec1 (diff) |
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: 7627122fd1c0 ("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>
Diffstat (limited to 'drivers/soc/imx')
0 files changed, 0 insertions, 0 deletions