mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
fs: cbfs: fix locating the cbfs header
The value at the end of the rom is not a pointer, it is an offset relative to the end of rom. Signed-off-by: Andre Heider <a.heider@gmail.com>
This commit is contained in:
parent
33222c8a2c
commit
44683170f8
1 changed files with 2 additions and 2 deletions
|
@ -168,9 +168,9 @@ static int file_cbfs_load_header(uintptr_t end_of_rom,
|
|||
struct cbfs_header *header)
|
||||
{
|
||||
struct cbfs_header *header_in_rom;
|
||||
int32_t offset = *(u32 *)(end_of_rom - 3);
|
||||
|
||||
header_in_rom = (struct cbfs_header *)(uintptr_t)
|
||||
*(u32 *)(end_of_rom - 3);
|
||||
header_in_rom = (struct cbfs_header *)(end_of_rom + offset + 1);
|
||||
swap_header(header, header_in_rom);
|
||||
|
||||
if (header->magic != good_magic || header->offset >
|
||||
|
|
Loading…
Reference in a new issue