Commit 245ae5e9 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: add some error handling to amdgpu_init v2

Just to be clean should we ever run into -ENOMEM during module init.

v2: fix typo in commit message
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c24784f0
...@@ -735,9 +735,20 @@ static struct pci_driver amdgpu_kms_pci_driver = { ...@@ -735,9 +735,20 @@ static struct pci_driver amdgpu_kms_pci_driver = {
static int __init amdgpu_init(void) static int __init amdgpu_init(void)
{ {
amdgpu_sync_init(); int r;
amdgpu_fence_slab_init();
amd_sched_fence_slab_init(); r = amdgpu_sync_init();
if (r)
goto error_sync;
r = amdgpu_fence_slab_init();
if (r)
goto error_fence;
r = amd_sched_fence_slab_init();
if (r)
goto error_sched;
if (vgacon_text_force()) { if (vgacon_text_force()) {
DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n"); DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
return -EINVAL; return -EINVAL;
...@@ -749,6 +760,15 @@ static int __init amdgpu_init(void) ...@@ -749,6 +760,15 @@ static int __init amdgpu_init(void)
amdgpu_register_atpx_handler(); amdgpu_register_atpx_handler();
/* let modprobe override vga console setting */ /* let modprobe override vga console setting */
return drm_pci_init(driver, pdriver); return drm_pci_init(driver, pdriver);
error_sched:
amdgpu_fence_slab_fini();
error_fence:
amdgpu_sync_fini();
error_sync:
return r;
} }
static void __exit amdgpu_exit(void) static void __exit amdgpu_exit(void)
......
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