diff options
author | Christian König <christian.koenig@amd.com> | 2016-10-28 11:39:08 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-10-31 12:44:58 -0400 |
commit | 245ae5e915853ced749eb47a343749cf0a9c4109 (patch) | |
tree | 49d280ff9487a5d91e207b2fc8603990dc05b8e6 | |
parent | c24784f01549ecdf23fc00d0588423bcf8956714 (diff) |
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: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 73f2415630f8..02ff0747197c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |||
@@ -735,9 +735,20 @@ static struct pci_driver amdgpu_kms_pci_driver = { | |||
735 | 735 | ||
736 | static int __init amdgpu_init(void) | 736 | static int __init amdgpu_init(void) |
737 | { | 737 | { |
738 | amdgpu_sync_init(); | 738 | int r; |
739 | amdgpu_fence_slab_init(); | 739 | |
740 | amd_sched_fence_slab_init(); | 740 | r = amdgpu_sync_init(); |
741 | if (r) | ||
742 | goto error_sync; | ||
743 | |||
744 | r = amdgpu_fence_slab_init(); | ||
745 | if (r) | ||
746 | goto error_fence; | ||
747 | |||
748 | r = amd_sched_fence_slab_init(); | ||
749 | if (r) | ||
750 | goto error_sched; | ||
751 | |||
741 | if (vgacon_text_force()) { | 752 | if (vgacon_text_force()) { |
742 | DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n"); | 753 | DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n"); |
743 | return -EINVAL; | 754 | return -EINVAL; |
@@ -749,6 +760,15 @@ static int __init amdgpu_init(void) | |||
749 | amdgpu_register_atpx_handler(); | 760 | amdgpu_register_atpx_handler(); |
750 | /* let modprobe override vga console setting */ | 761 | /* let modprobe override vga console setting */ |
751 | return drm_pci_init(driver, pdriver); | 762 | return drm_pci_init(driver, pdriver); |
763 | |||
764 | error_sched: | ||
765 | amdgpu_fence_slab_fini(); | ||
766 | |||
767 | error_fence: | ||
768 | amdgpu_sync_fini(); | ||
769 | |||
770 | error_sync: | ||
771 | return r; | ||
752 | } | 772 | } |
753 | 773 | ||
754 | static void __exit amdgpu_exit(void) | 774 | static void __exit amdgpu_exit(void) |