mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 07:35:14 +00:00
drm/amdgpu:fix virtual dce bug
[ Upstream commit 129d65c18e
]
this fix the issue that access memory after freed
after driver unloaded.
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
bd301e538b
commit
6d6a5eae56
1 changed files with 3 additions and 1 deletions
|
@ -437,6 +437,8 @@ static int dce_virtual_sw_fini(void *handle)
|
||||||
drm_kms_helper_poll_fini(adev->ddev);
|
drm_kms_helper_poll_fini(adev->ddev);
|
||||||
|
|
||||||
drm_mode_config_cleanup(adev->ddev);
|
drm_mode_config_cleanup(adev->ddev);
|
||||||
|
/* clear crtcs pointer to avoid dce irq finish routine access freed data */
|
||||||
|
memset(adev->mode_info.crtcs, 0, sizeof(adev->mode_info.crtcs[0]) * AMDGPU_MAX_CRTCS);
|
||||||
adev->mode_info.mode_config_initialized = false;
|
adev->mode_info.mode_config_initialized = false;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -723,7 +725,7 @@ static void dce_virtual_set_crtc_vblank_interrupt_state(struct amdgpu_device *ad
|
||||||
int crtc,
|
int crtc,
|
||||||
enum amdgpu_interrupt_state state)
|
enum amdgpu_interrupt_state state)
|
||||||
{
|
{
|
||||||
if (crtc >= adev->mode_info.num_crtc) {
|
if (crtc >= adev->mode_info.num_crtc || !adev->mode_info.crtcs[crtc]) {
|
||||||
DRM_DEBUG("invalid crtc %d\n", crtc);
|
DRM_DEBUG("invalid crtc %d\n", crtc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue