diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2023-05-13 10:00:55 +0200 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2023-05-13 11:09:51 +0200 |
commit | bd646fc3deeb0c274a7fa61e3727916aadd23dc7 (patch) | |
tree | 2effbdc1893619235d64fe668eb0d52ab099318b /lib | |
parent | d76184edc31292bd68ef1b63e7dfc3f11cd8bada (diff) | |
download | u-boot-bd646fc3deeb0c274a7fa61e3727916aadd23dc7.zip u-boot-bd646fc3deeb0c274a7fa61e3727916aadd23dc7.tar.gz u-boot-bd646fc3deeb0c274a7fa61e3727916aadd23dc7.tar.bz2 |
efi_loader: duplicate code in efi_dp_from_name
efi_dp_from_name() has duplicate code to replace slash by backslash.
path_to_uefi() called by efi_dp_from_file() already does this.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_device_path.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index a6a6ef0..c4f0cc2 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -1187,8 +1187,6 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr, size_t image_size; void *image_addr; int part = 0; - char *filename; - char *s; if (path && !file) return EFI_INVALID_PARAMETER; @@ -1220,17 +1218,7 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr, if (!path) return EFI_SUCCESS; - filename = calloc(1, strlen(path) + 1); - if (!filename) - return EFI_OUT_OF_RESOURCES; - - sprintf(filename, "%s", path); - /* DOS style file path: */ - s = filename; - while ((s = strchr(s, '/'))) - *s++ = '\\'; - *file = efi_dp_from_file(desc, part, filename); - free(filename); + *file = efi_dp_from_file(desc, part, path); if (!*file) return EFI_INVALID_PARAMETER; |