Patrick Georgi (patrick(a)georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6560
-gerrit
commit 8820eb32dfa8d454ef4dd67127f22a05c4c9f446
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat Aug 9 17:02:00 2014 +0200
nvramtool: check for successful seek
Otherwise the following write might end up anywhere.
Change-Id: Ie42d984824e9308bd58b8bb905b6ea823543adf0
Found-by: Coverity Scan
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
---
util/nvramtool/cli/nvramtool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/util/nvramtool/cli/nvramtool.c b/util/nvramtool/cli/nvramtool.c
index d5acc58..bdfaaff 100644
--- a/util/nvramtool/cli/nvramtool.c
+++ b/util/nvramtool/cli/nvramtool.c
@@ -163,8 +163,8 @@ int main(int argc, char *argv[])
}
if (fd_stat.st_size < CMOS_SIZE) {
- lseek(fd, CMOS_SIZE - 1, SEEK_SET);
- if (write(fd, "\0", 1) != 1) {
+ if ((lseek(fd, CMOS_SIZE - 1, SEEK_SET) == -1) ||
+ (write(fd, "\0", 1) != 1)) {
fprintf(stderr, "Unable to extended '%s' to its full size.\n",
nvramtool_op_modifiers[NVRAMTOOL_MOD_USE_CMOS_FILE].param);
exit(1);
Patrick Georgi (patrick(a)georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6559
-gerrit
commit fc63761e7e73a8e411e0fe30da1f7d4147d8912a
Author: Patrick Georgi <patrick(a)georgi-clan.de>
Date: Sat Aug 9 16:58:00 2014 +0200
cbfstool: free stale memory
The process probably terminates not much later, but in
case anyone reuses the function in something with
longer life-time, free unused resources.
Change-Id: I10c471ee3d9dc9a3ebf08fe4605f223ea59b990e
Found-by: Coverity Scan
Signed-off-by: Patrick Georgi <patrick(a)georgi-clan.de>
---
util/cbfstool/elfheaders.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/util/cbfstool/elfheaders.c b/util/cbfstool/elfheaders.c
index 5b5cf94..71d34a9 100644
--- a/util/cbfstool/elfheaders.c
+++ b/util/cbfstool/elfheaders.c
@@ -281,8 +281,10 @@ phdr_read(const struct buffer *in, struct parsed_elf *pelf,
/* Ensure the contents are valid within the elf file. */
if (check_size(in, phdr[i].p_offset, phdr[i].p_filesz,
- "segment contents"))
+ "segment contents")) {
+ free(phdr);
return -1;
+ }
}
pelf->phdr = phdr;
@@ -422,6 +424,7 @@ static int strtab_read(const struct buffer *in, struct parsed_elf *pelf)
buffer_splice(b, in, shdr->sh_offset, shdr->sh_size);
if (check_size(in, shdr->sh_offset, buffer_size(b), "strtab")) {
ERROR("STRTAB section not within bounds: %d\n", i);
+ free(b);
return -1;
}
pelf->strtabs[i] = b;
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6558
-gerrit
commit 69c88c06c91ef5baf6e0eeed2e92dffd33c510ef
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Sat Aug 9 21:35:39 2014 +1000
southbridge/amd/cs5536/early_setup.c: Add missing includes
Change-Id: Ida73108316f81a6bfabcee7b9ba5637490d0a5a3
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
src/southbridge/amd/cs5536/early_setup.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/southbridge/amd/cs5536/early_setup.c b/src/southbridge/amd/cs5536/early_setup.c
index d9a042a..df66bee 100644
--- a/src/southbridge/amd/cs5536/early_setup.c
+++ b/src/southbridge/amd/cs5536/early_setup.c
@@ -22,6 +22,10 @@
* This file implements the initialization sequence documented in section 4.2 of
* AMD Geode GX Processor CS5536 Companion Device GeodeROM Porting Guide.
*/
+#include <arch/io.h>
+#include <cpu/x86/msr.h>
+#include <stdint.h>
+
#include "cs5536.h"
/**