Browse Source

securemsm-kernel: smcinvoke: update error code for Invoke failed

Return OBJECT_ERROR_BUSY if the Object is busy.
Return OBJECT_ERROR_KMEM if Out of memory.
Return OBJECT_ERROR_UNAVAIL if the request could not be processed.

Change-Id: I17b9ecd7dd817b445d84cb7d01b019497248a2a3
Spencer Willett 2 years ago
parent
commit
50845e2d72
1 changed files with 8 additions and 1 deletions
  1. 8 1
      smcinvoke/smcinvoke_kernel.c

+ 8 - 1
smcinvoke/smcinvoke_kernel.c

@@ -250,7 +250,14 @@ static int invoke_over_smcinvoke(void *cxt,
 				close_fd(obj.fd);
 			}
 		}
-		ret = OBJECT_ERROR_KMEM;
+		if (ret == -EBUSY) {
+			ret = OBJECT_ERROR_BUSY;
+		}
+		else if (ret == -ENOMEM){
+			ret = OBJECT_ERROR_KMEM;
+		} else {
+			ret = OBJECT_ERROR_UNAVAIL;
+		}
 		goto exit;
 	}