Skip to content

Commit

Permalink
dtb: Never pass UEFI DTB buffer directly; fix misuse of libfdt API. C…
Browse files Browse the repository at this point in the history
…loses #384
  • Loading branch information
mintsuki committed Jul 12, 2024
1 parent cb6832b commit 3759fa1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions common/lib/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,9 @@ void *get_device_tree_blob(size_t extra_size) {

printv("efi: found dtb at %p, size %x\n", cur_table->VendorTable, s);

if (extra_size == 0) {
return cur_table->VendorTable;
}

void *new_tab = ext_mem_alloc(s + extra_size);

ret = fdt_resize(cur_table->VendorTable, new_tab, s + extra_size);
ret = fdt_open_into(cur_table->VendorTable, new_tab, s + extra_size);
if (ret < 0) {
panic(true, "dtb: failed to resize new DTB");
}
Expand Down

0 comments on commit 3759fa1

Please sign in to comment.