projects
/
seabios.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1bedcc0
)
Exit CBFS file search early if zero signature found.
author
Kevin O'Connor
<kevin@koconnor.net>
Mon, 27 Apr 2009 01:27:15 +0000
(21:27 -0400)
committer
Kevin O'Connor
<kevin@koconnor.net>
Mon, 27 Apr 2009 01:27:15 +0000
(21:27 -0400)
This stops the scan from walking all of flash.
src/coreboot.c
patch
|
blob
|
history
diff --git
a/src/coreboot.c
b/src/coreboot.c
index cdb13ba5da2de2bd5c7e45c03e59f4824bc7ad9b..17c953126d94ecd793fdefdbe54e6b8ce01d19f0 100644
(file)
--- 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);
}
}