From mboxrd@z Thu Jan 1 00:00:00 1970 From: AKASHI Takahiro Date: Mon, 22 Apr 2019 09:44:33 +0900 Subject: [U-Boot] [PATCH 8/9] efi_loader: rework bootmgr/bootefi using load_image API In-Reply-To: References: <20190419032236.8242-1-takahiro.akashi@linaro.org> <20190419032236.8242-9-takahiro.akashi@linaro.org> Message-ID: <20190422004432.GZ7158@linaro.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sat, Apr 20, 2019 at 10:07:20AM +0200, Heinrich Schuchardt wrote: > On 4/19/19 5:22 AM, AKASHI Takahiro wrote: > >+ /* > >+ * FIXME: Who is responsible for > >+ * free(loaded_image_info->load_options); > >+ * Once efi_exit() is implemented correctly, > >+ * handle itself doesn't exist here. > >+ */ > > Load option can only be freed when the image is unloaded. For > applications that will happen when the application call Exit(). For > drivers there is not guarantee that they will be ever unloaded. Should we be able to utilize "bootargs" even for drivers? > In Unload() we should not free load options if they were not allocated > by us but by an EFI binary. > > In your implementation you have allocated the load options via calloc() > and not from the EFI pool. So this may allow us to determine whether we > allocated the load options in the Unload() service. DO you mean: efi_unload_image(...) ret = EFI_CALL(efi_pool_free(info->load_options)); if (ret != EFI_SUCCESS) /* * Don't care, assuming that load_options have been allocated * by application. */ It looks fragile. -Takahiro Akashi > Best regards > > Heinrich