Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9216ed29 authored by Oded Gabbay's avatar Oded Gabbay
Browse files

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: default avatarOded Gabbay <oded.gabbay@amd.com>
parent c2e1b3a4
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);