mirror_ubuntu-kernels/drivers/gpu/drm/amd
Jiri Kosina 4ef87d8f10 drm/amdgpu: Fix resource leak on probe error path
This reverts commit 4192f7b576.

It is not true (as stated in the reverted commit changelog) that we never
unmap the BAR on failure; it actually does happen properly on
amdgpu_driver_load_kms() -> amdgpu_driver_unload_kms() ->
amdgpu_device_fini() error path.

What's worse, this commit actually completely breaks resource freeing on
probe failure (like e.g. failure to load microcode), as
amdgpu_driver_unload_kms() notices adev->rmmio being NULL and bails too
early, leaving all the resources that'd normally be freed in
amdgpu_acpi_fini() and amdgpu_device_fini() still hanging around, leading
to all sorts of oopses when someone tries to, for example, access the
sysfs and procfs resources which are still around while the driver is
gone.

Fixes: 4192f7b576 ("drm/amdgpu: unmap register bar on device init failure")
Reported-by: Vojtech Pavlik <vojtech@ucw.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2021-07-01 12:09:19 -04:00
..
acp
amdgpu drm/amdgpu: Fix resource leak on probe error path 2021-07-01 12:09:19 -04:00
amdkfd drm/amdkfd: Maintain svm_bo reference in page->zone_device_data 2021-07-01 00:05:41 -04:00
display drm/amd/display: Extend DMUB diagnostic logging to DCN3.1 2021-07-01 00:05:40 -04:00
include drm/amdgpu: add license to umc_8_7_0_sh_mask.h 2021-07-01 00:25:33 -04:00
pm drm/amd/pm: Simplify managed I2C transfer of Aldebaran 2021-07-01 00:25:33 -04:00