summaryrefslogtreecommitdiff
path: root/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
diff options
context:
space:
mode:
authorLiu Ying <victor.liu@nxp.com>2020-04-21 15:57:03 +0800
committerLiu Ying <victor.liu@nxp.com>2020-04-22 18:10:11 +0800
commit71b632b3798a59f78b4680535580418bb46b7f98 (patch)
treee5a5787ef186b0c398421dbfda2dbcc018143355 /arch/arm64/boot/dts/freescale/imx8mp-evk.dts
parent345aa7cc770c922f793693e6d50792d6366368c9 (diff)
LF-1256-3 drm/imx: dpu: crtc: Allocate dpu_crtc in ->probe() instead of ->bind()
The structure dpu_crtc essentially contains drm crtc. If we allocate the instance of the structure dpu_crtc with devm_kzalloc() in ->bind(), it would be freed in case anything in dpu_crtc_init() fails after the call for drm_crtc_init_with_planes(). However, drm_crtc_init_with_planes() may have already added the crtc into the crtc_list. The function drm_mode_config_cleanup() called in imx_drm_bind() as a part of it's bailout logic would walk through the list to try to cleanup the crtc, which would cause the use-after-free issue. This patch changes the dpu_crtc allocation from ->bind() to ->probe() to fix the issue. And, with this change, ->unbind() doesn't need to cleanup the crtc anymore, since it can be done by the imx-drm core driver. Reviewed-by: Sandor Yu <Sandor.yu@nxp.com> Signed-off-by: Liu Ying <victor.liu@nxp.com>
Diffstat (limited to 'arch/arm64/boot/dts/freescale/imx8mp-evk.dts')
0 files changed, 0 insertions, 0 deletions