Skip to content

Commit

Permalink
optee-utee: Add method to check if TransientObject is created with nu…
Browse files Browse the repository at this point in the history
…ll handle

Signed-off-by: zengxiaobo <[email protected]>
  • Loading branch information
zengxiaobo authored and DemesneGH committed Sep 18, 2024
1 parent 0f1f526 commit 3177d4f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions optee-utee/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ impl ObjectHandle {
unsafe { *(self.raw) }
}

fn is_null(&self) -> bool {
self.raw.is_null()
}

fn from_raw(raw: *mut raw::TEE_ObjectHandle) -> ObjectHandle {
Self { raw }
}
Expand Down Expand Up @@ -517,6 +521,15 @@ impl TransientObject {
Self(ObjectHandle::from_raw(ptr::null_mut()))
}

/// Check if current object is created with null handle.
///
/// # See Also
///
/// - [Self::null_object](Self::null_object).
pub fn is_null_object(&self) -> bool {
self.0.is_null()
}

/// Allocate an uninitialized [TransientObject](TransientObject), i.e. a container for attributes.
///
/// As allocated, the object is uninitialized.
Expand Down

0 comments on commit 3177d4f

Please sign in to comment.