]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/amdgpu: prevent toc firmware memory leak
authorGuchun Chen <guchun.chen@amd.com>
Fri, 2 Sep 2022 06:08:55 +0000 (14:08 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 8 Sep 2022 02:28:42 +0000 (22:28 -0400)
It's missed in psp fini.

Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index 28ca0a94b8a5d030610a29abe929bab17701192e..cfcaf890a6a1224eb02b7ff9a8f44db4c7b4d40b 100644 (file)
@@ -496,11 +496,14 @@ static int psp_sw_fini(void *handle)
                release_firmware(psp->ta_fw);
                psp->ta_fw = NULL;
        }
-       if (adev->psp.cap_fw) {
+       if (psp->cap_fw) {
                release_firmware(psp->cap_fw);
                psp->cap_fw = NULL;
        }
-
+       if (psp->toc_fw) {
+               release_firmware(psp->toc_fw);
+               psp->toc_fw = NULL;
+       }
        if (adev->ip_versions[MP0_HWIP][0] == IP_VERSION(11, 0, 0) ||
            adev->ip_versions[MP0_HWIP][0] == IP_VERSION(11, 0, 7))
                psp_sysfs_fini(adev);