diff options
author | Oded Gabbay <oded.gabbay@amd.com> | 2015-01-12 21:34:21 +0100 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@amd.com> | 2015-01-12 21:34:21 +0100 |
commit | 9216ed294053be68a673754a0f8da88aa7fb7941 (patch) | |
tree | 0c31b11678e3e122762ad535ea7af4478aa5d5c8 /drivers/gpu/drm/amd | |
parent | drm/amdkfd: Fix logic of destroy_queue_nocpsch() (diff) | |
download | linux-9216ed294053be68a673754a0f8da88aa7fb7941.tar.xz linux-9216ed294053be68a673754a0f8da88aa7fb7941.zip |
drm/amdkfd: Don't BUG on freeing GART sub-allocation
Instead of creating a BUG if trying to free a NULL GART sub-allocation object,
just return 0 (success).
This is done to mirror behavior of kfree.
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index 24b37ffad5c6..a23ed2440080 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c @@ -511,7 +511,10 @@ int kfd_gtt_sa_free(struct kfd_dev *kfd, struct kfd_mem_obj *mem_obj) unsigned int bit; BUG_ON(!kfd); - BUG_ON(!mem_obj); + + /* Act like kfree when trying to free a NULL object */ + if (!mem_obj) + return 0; pr_debug("kfd: free mem_obj = %p, range_start = %d, range_end = %d\n", mem_obj, mem_obj->range_start, mem_obj->range_end); |