Commit 8b11e14b authored by Bernard Zhao's avatar Bernard Zhao Committed by Alex Deucher

drm/amd/amdgpu: cleanup the code style a bit

This change is to cleanup the code style a bit.
Signed-off-by: default avatarBernard Zhao <bernard@vivo.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7b755d65
...@@ -283,17 +283,15 @@ static int amdgpu_virt_init_ras_err_handler_data(struct amdgpu_device *adev) ...@@ -283,17 +283,15 @@ static int amdgpu_virt_init_ras_err_handler_data(struct amdgpu_device *adev)
*data = kmalloc(sizeof(struct amdgpu_virt_ras_err_handler_data), GFP_KERNEL); *data = kmalloc(sizeof(struct amdgpu_virt_ras_err_handler_data), GFP_KERNEL);
if (!*data) if (!*data)
return -ENOMEM; goto data_failure;
bps = kmalloc_array(align_space, sizeof((*data)->bps), GFP_KERNEL); bps = kmalloc_array(align_space, sizeof((*data)->bps), GFP_KERNEL);
bps_bo = kmalloc_array(align_space, sizeof((*data)->bps_bo), GFP_KERNEL); if (!bps)
goto bps_failure;
if (!bps || !bps_bo) { bps_bo = kmalloc_array(align_space, sizeof((*data)->bps_bo), GFP_KERNEL);
kfree(bps); if (!bps_bo)
kfree(bps_bo); goto bps_bo_failure;
kfree(*data);
return -ENOMEM;
}
(*data)->bps = bps; (*data)->bps = bps;
(*data)->bps_bo = bps_bo; (*data)->bps_bo = bps_bo;
...@@ -303,6 +301,13 @@ static int amdgpu_virt_init_ras_err_handler_data(struct amdgpu_device *adev) ...@@ -303,6 +301,13 @@ static int amdgpu_virt_init_ras_err_handler_data(struct amdgpu_device *adev)
virt->ras_init_done = true; virt->ras_init_done = true;
return 0; return 0;
bps_bo_failure:
kfree(bps);
bps_failure:
kfree(*data);
data_failure:
return -ENOMEM;
} }
static void amdgpu_virt_ras_release_bp(struct amdgpu_device *adev) static void amdgpu_virt_ras_release_bp(struct amdgpu_device *adev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment