]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/amdgpu: fix crash in acp_hw_fini
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 3 Nov 2016 21:47:51 +0000 (17:47 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Nov 2016 17:40:52 +0000 (12:40 -0500)
On CZ/ST systems with AZ rather than ACP audio, we need to bail
early in hw_fini since there is nothing to do.

bug: https://bugs.freedesktop.org/show_bug.cgi?id=98276

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c

index 892d60fb225b56b25d7a44edec959ab56f45ed90..2057683f7b5998d3641cf20af336838ee72d27d2 100644 (file)
@@ -395,9 +395,12 @@ static int acp_hw_fini(void *handle)
 {
        int i, ret;
        struct device *dev;
-
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+       /* return early if no ACP */
+       if (!adev->acp.acp_genpd)
+               return 0;
+
        for (i = 0; i < ACP_DEVS ; i++) {
                dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i);
                ret = pm_genpd_remove_device(&adev->acp.acp_genpd->gpd, dev);