FFA: Set and verify allocator of memory handle

Change-Id: I19dff61311228399cdf8f26a855e91981473a8a7
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/src/api.c b/src/api.c
index f0766a8..41bc1a3 100644
--- a/src/api.c
+++ b/src/api.c
@@ -9,6 +9,7 @@
 #include "hf/api.h"
 
 #include "hf/arch/cpu.h"
+#include "hf/arch/ffa_memory_handle.h"
 #include "hf/arch/mm.h"
 #include "hf/arch/other_world.h"
 #include "hf/arch/timer.h"
@@ -2103,8 +2104,7 @@
 	struct vm *to = current->vm;
 	struct ffa_value ret;
 
-	if ((handle & FFA_MEMORY_HANDLE_ALLOCATOR_MASK) ==
-	    FFA_MEMORY_HANDLE_ALLOCATOR_HYPERVISOR) {
+	if (ffa_memory_handle_allocated_by_current_world(handle)) {
 		struct vm_locked to_locked = vm_lock(to);
 
 		ret = ffa_memory_reclaim(to_locked, handle, flags,