If we have a device path that is not the usual file system directory
get_extra_dir() will return NULL. Handle that gracefully.
Fixes: #30228
if (err != EFI_SUCCESS)
return log_error_status(err, "Unable to open root directory: %m");
- if (!dropin_dir)
+ if (!dropin_dir) {
dropin_dir = rel_dropin_dir = get_extra_dir(loaded_image->FilePath);
+ if (!dropin_dir)
+ goto nothing;
+ }
err = open_directory(root, dropin_dir, &extra_dir);
if (err == EFI_NOT_FOUND)
log_error_status(err, "Error loading global addons, ignoring: %m");
/* Some bootloaders always pass NULL in FilePath, so we need to check for it here. */
- if (loaded_image->FilePath) {
- _cleanup_free_ char16_t *dropin_dir = get_extra_dir(loaded_image->FilePath);
+ _cleanup_free_ char16_t *dropin_dir = get_extra_dir(loaded_image->FilePath);
+ if (dropin_dir) {
err = load_addons(
image,
loaded_image,