drm/amdgpu: Fix NULL ptr on driver unload due to init failure.
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix NULL ptr on driver unload due to init failure.
Problem:
When unloading due to failure amdgpu_device_fini was called twice which was leading to NULL ptr in amdgpu_irq_disable_all.
Fix:
Call amdgpu_device_fini only once from amdgpu_driver_unload_kms.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -1
@@ -2023,7 +2023,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, }dev_err (adev->dev,"amdgpu_device_ip_init failed\n" );amdgpu_vf_error_put (adev,AMDGIM_ERROR_VF_AMDGPU_INIT_FAIL ,0 ,0 ); -amdgpu_device_ip_fini (adev); goto failed; }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1521656572-19414-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org
Alex Deucher
Reviewed-byQuoted 8 lines · Andrey Grodzovsky
Problem:
When unloading due to failureamdgpu_device_finiwas called twice which was leading to NULL ptr inamdgpu_irq_disable_all.Fix:
Callamdgpu_device_finionly once fromamdgpu_driver_unload_kms.Signed-off-by Andrey Grodzovsky <[email protected]>
Quoted 19 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0
-2@@ -2023,7 +2023,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, }dev_err (adev->dev,"amdgpu_device_ip_init failed\n" );amdgpu_vf_error_put (adev,AMDGIM_ERROR_VF_AMDGPU_INIT_FAIL ,0 ,0 ); -amdgpu_device_ip_fini (adev); goto failed; } --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
kfree(adev->irq.client[i].sources);
+adev->irq.client[i].sources = NULL;
Set adev->irq.client[i].sources to NULL in amdgpu_irq_fini also can fix NULL ptr in amdgpu_irq_disable_all..
But I didn't check why amdgpu_device_fini was called twice.
This patch looks good.
Best Regards
Rex
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Andrey Grodzovsky
Sent: Thursday, March 22, 2018 2:23 AM
To: [email protected]
Cc: Grodzovsky, Andrey
Subject: [PATCH] drm/amdgpu: Fix NULL ptr on driver unload due to init failure.
Problem:
When unloading due to failure amdgpu_device_fini was called twice which was leading to NULL ptr in amdgpu_irq_disable_all.
Fix:
Call amdgpu_device_fini only once from amdgpu_driver_unload_kms.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -1
@@ -2023,7 +2023,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, }dev_err (adev->dev,"amdgpu_device_ip_init failed\n" );amdgpu_vf_error_put (adev,AMDGIM_ERROR_VF_AMDGPU_INIT_FAIL ,0 ,0 ); -amdgpu_device_ip_fini (adev); goto failed; }
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx