aboutsummaryrefslogtreecommitdiffstats
path: root/src/coreboot.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-04-26 21:27:15 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-04-26 21:27:15 -0400
commit214f6c2d4cedc84227b7ea453712ab9ddb373d0c (patch)
tree5ee4a9e21285354d1544cfe8e6f50133bf0b4301 /src/coreboot.c
parent1bedcc092a4b3b98f690e7784c89bd2baf8c5918 (diff)
downloadseabios-214f6c2d4cedc84227b7ea453712ab9ddb373d0c.tar.gz
Exit CBFS file search early if zero signature found.
This stops the scan from walking all of flash.
Diffstat (limited to 'src/coreboot.c')
-rw-r--r--src/coreboot.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/coreboot.c b/src/coreboot.c
index cdb13ba5..17c95312 100644
--- a/src/coreboot.c
+++ b/src/coreboot.c
@@ -331,8 +331,11 @@ cbfs_search(struct cbfs_file *file)
for (;;) {
if (file < (struct cbfs_file *)(0xFFFFFFFF - ntohl(CBHDR->romsize)))
return NULL;
- if (file->magic == CBFS_FILE_MAGIC)
+ u64 magic = file->magic;
+ if (magic == CBFS_FILE_MAGIC)
return file;
+ if (magic == 0)
+ return NULL;
file = (void*)file + ntohl(CBHDR->align);
}
}