Files
android_kernel_xiaomi_sm8450/drivers/gpu/drm/amd/amdgpu
Jiri Kosina fc2756cce0 drm/amdgpu: Fix resource leak on probe error path
commit d47255d3f87338164762ac56df1f28d751e27246 upstream.

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>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-04 12:46:41 +02:00
..
2021-06-03 09:00:44 +02:00
2019-09-16 09:59:21 -05:00
2019-06-20 11:36:22 -05:00
2021-06-03 09:00:45 +02:00
2017-10-20 13:28:44 -04:00
2019-06-10 23:00:01 +02:00
2020-10-30 01:17:43 -04:00
2021-03-09 11:11:12 +01:00
2020-05-22 13:41:53 -04:00
2020-07-02 12:02:50 -04:00
2020-07-01 01:59:24 -04:00
2020-08-14 16:22:39 -04:00
2020-11-24 12:30:37 -05:00
2020-07-01 01:59:24 -04:00
2020-09-22 17:37:38 -04:00
2020-09-22 17:37:38 -04:00
2020-09-22 17:37:38 -04:00
2020-07-02 12:02:50 -04:00