RFC drm/amdgpu: Fix NULL-deref in amdgpu_device_fini_sw()
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest1 patch 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/1 | drm/amdgpu: Fix null-ptr-deref in amdgpu_device_fini_sw()drivers/ | +4 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/1] drm/amdgpu: Fix NULL-deref in amdgpu_device_fini_sw()
Hi,
There are several reports of "Fatal error during GPU init" will cause NULL-deref in amdgpu_device_fini_sw(). Although the NULL-deref is result instead of reason, this NULL-deref will confuse user.
https://lore.kernel.org/lkml/[email protected]/
https://lore.kernel.org/lkml/[email protected]/
This is probably because "adev" is not fully initialized when amdgpu_device_init() failed. Thus subsequent amdgpu_device_fini_sw() will try to release "adev->reset_domain" and cause NULL-deref.
This patch fixes this problem by guarding the code with an "if". However, I'm new to this module and I didn't fully understand the code, so please review my code carefully.
Best Regards,
Zhang Boyang