drm/amdgpu/sriov:fix missing error handling
authorMonk Liu <Monk.Liu@amd.com>
Tue, 12 Sep 2017 06:33:29 +0000 (14:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 19:14:07 +0000 (15:14 -0400)
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

index 79d9ab43d42c0994f3a00ff0ceaf8ab9026df091..4fd06f8d9768b8de33e83c0fc91929fae19ee5b2 100644 (file)
@@ -841,8 +841,11 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
 
        if (amdgpu_sriov_vf(adev)) {
                r = amdgpu_map_static_csa(adev, &fpriv->vm, &fpriv->csa_va);
-               if (r)
+               if (r) {
+                       amdgpu_vm_fini(adev, &fpriv->vm);
+                       kfree(fpriv);
                        goto out_suspend;
+               }
        }
 
        mutex_init(&fpriv->bo_list_lock);