Skip to content

Commit e3f0338

Browse files
committed
Silence minor nit in load-options parsing debug output
Previously when there were no load options, this would go in the debug log: load-options.c:313:parse_load_options() full load options: include/hexdump.h:92:vhexdumpf() hexdump of a NULL pointer! This changes it to say: load-options.c:315:parse_load_options() LoadOptions is empty Signed-off-by: Peter Jones <pjones@redhat.com>
1 parent d972515 commit e3f0338

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

load-options.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,13 @@ parse_load_options(EFI_LOADED_IMAGE *li)
311311
UINT32 remaining_size;
312312
CHAR16 *loader_str = NULL;
313313

314-
dprint(L"full load options:\n");
315-
dhexdumpat(li->LoadOptions, li->LoadOptionsSize, 0);
314+
if (!li->LoadOptions || !li->LoadOptionsSize) {
315+
dprint(L"LoadOptions is empty\n");
316+
return EFI_SUCCESS;
317+
} else {
318+
dprint(L"full LoadOptions:\n");
319+
dhexdumpat(li->LoadOptions, li->LoadOptionsSize, 0);
320+
}
316321

317322
/*
318323
* Sanity check since we make several assumptions about the length

0 commit comments

Comments
 (0)