diff options
author | Shashank Sharma <shashank.sharma@amd.com> | 2023-02-27 15:42:28 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-03-09 22:06:19 -0500 |
commit | 20534dbcc7b7bfb447279cdcfb0d88ee3b779a18 (patch) | |
tree | bda936d8a09853060d42af830255d0a0fcdb5f52 /drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c | |
parent | 1717cc5f2962a4652c76ed3858b499ccae6c277c (diff) | |
download | linux-stable-20534dbcc7b7bfb447279cdcfb0d88ee3b779a18.tar.gz linux-stable-20534dbcc7b7bfb447279cdcfb0d88ee3b779a18.tar.bz2 linux-stable-20534dbcc7b7bfb447279cdcfb0d88ee3b779a18.zip |
drm/amdgpu: fix return value check in kfd
This patch fixes a return value check in kfd doorbell handling.
This function should return 0(error) only when the ida_simple_get
returns < 0(error), return > 0 is a success case.
Cc: Felix Kuehling <Felix.Kuehling@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Fixes: 16f0013157bf ("drm/amdkfd: Allocate doorbells only when needed")
Acked-by: Christian Koenig <chriatian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Shashank Sharma <shashank.sharma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c b/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c index cbef2e147da5..38c9e1ca6691 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_doorbell.c @@ -280,7 +280,7 @@ phys_addr_t kfd_get_process_doorbells(struct kfd_process_device *pdd) if (!pdd->doorbell_index) { int r = kfd_alloc_process_doorbells(pdd->dev, &pdd->doorbell_index); - if (r) + if (r < 0) return 0; } |