diff options
author | Heinrich Schuchardt | 2023-07-30 14:03:53 +0200 |
---|---|---|
committer | Heinrich Schuchardt | 2023-08-03 09:21:03 +0200 |
commit | cff7700170c2eb9d8059acbc2a5664ee9c8a8a9b (patch) | |
tree | 816c770d332a8dbbd9bbe32691253df2f839eedd /include/efi_loader.h | |
parent | ecae4bbf35fac3cde0c41c012a05c8e5b4ade90f (diff) |
efi_loader: error handling in efi_disk_add_dev
* If an error occurs in efi_disk_add_dev(), don't leak resources.
* If calloc() fails while creating the file system protocol interface,
signal an error.
* Rename efi_simple_file_system() to efi_create_simple_file_system().
* Drop a little helpful debug message.
Fixes: 2a92080d8c44 ("efi_loader: add file/filesys support")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'include/efi_loader.h')
-rw-r--r-- | include/efi_loader.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h index 3a64eb9c667..4a29ddaef42 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -696,9 +696,21 @@ void efi_signal_event(struct efi_event *event); /* return true if the device is removable */ bool efi_disk_is_removable(efi_handle_t handle); -/* open file system: */ -struct efi_simple_file_system_protocol *efi_simple_file_system( - struct blk_desc *desc, int part, struct efi_device_path *dp); +/** + * efi_create_simple_file_system() - create simple file system protocol + * + * Create a simple file system protocol for a partition. + * + * @desc: block device descriptor + * @part: partition number + * @dp: device path + * @fsp: simple file system protocol + * Return: status code + */ +efi_status_t +efi_create_simple_file_system(struct blk_desc *desc, int part, + struct efi_device_path *dp, + struct efi_simple_file_system_protocol **fsp); /* open file from device-path: */ struct efi_file_handle *efi_file_from_path(struct efi_device_path *fp); |