From 272c18cf9baad05e3010f45800c83f54b4c19175 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Thu, 23 Jun 2022 03:15:49 +0000 Subject: [PATCH] kata-proc-manager: small code shuffle Move the container slot release up as it logically belongs with the seL4BundleImpl construction. This makes clear it's unrelated to the actual start operation. Change-Id: Idda2a4a829fe6fae2a4d1dbe99aff495ef10b3b8 GitOrigin-RevId: ba2cdc9f4bfb54cfbeca11888bd31cd5657d0182 --- .../components/ProcessManager/kata-proc-manager/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/system/components/ProcessManager/kata-proc-manager/src/lib.rs b/apps/system/components/ProcessManager/kata-proc-manager/src/lib.rs index 8776d79..f2643c0 100644 --- a/apps/system/components/ProcessManager/kata-proc-manager/src/lib.rs +++ b/apps/system/components/ProcessManager/kata-proc-manager/src/lib.rs @@ -141,12 +141,12 @@ impl ProcessManagerInterface for KataManagerInterface { let bundle_frames = kata_security_load_application(&bundle.app_id, &container_slot)?; let mut sel4_bundle = seL4BundleImpl::new(bundle, &bundle_frames)?; - sel4_bundle.start()?; - // sel4_bundle owns container_slot now; release our ref so it's not // reclaimed when container_slot goes out of scope. container_slot.release(); + sel4_bundle.start()?; + Ok(Box::new(sel4_bundle) as _) } fn stop(&mut self, bundle_impl: &mut dyn BundleImplInterface) -> Result<(), ProcessManagerError> {