Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/34848 )
Change subject: linux_spi: Use fgets() to read buffer size
......................................................................
linux_spi: Use fgets() to read buffer size
Since fread() returns the number of bytes read, this currently will only
check for errors if it returns 0 (i.e. the file was empty). However, it
is possible for fread() to encounter an error after reading a few bytes,
which this doesn't catch. Fix this by using fgets() instead, which will
return NULL if EOF or an error is encountered, and is simpler anyway.
Change-Id: I4f37c70e97149b87c6344e63a57d11ddde7638c4
Signed-off-by: Jacob Garber <jgarber1(a)ualberta.ca>
Found-by: Coverity CID 1403824
---
M linux_spi.c
1 file changed, 1 insertion(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/48/34848/1
diff --git a/linux_spi.c b/linux_spi.c
index de09e60..e3d7486 100644
--- a/linux_spi.c
+++ b/linux_spi.c
@@ -137,8 +137,7 @@
}
char buf[10];
- memset(buf, 0, sizeof(buf));
- if (!fread(buf, 1, sizeof(buf) - 1, fp)) {
+ if (!fgets(buf, sizeof(buf), fp)) {
if (feof(fp))
msg_pwarn("Cannot read %s: file is empty.\n", BUF_SIZE_FROM_SYSFS);
else
--
To view, visit https://review.coreboot.org/c/flashrom/+/34848
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I4f37c70e97149b87c6344e63a57d11ddde7638c4
Gerrit-Change-Number: 34848
Gerrit-PatchSet: 1
Gerrit-Owner: Jacob Garber <jgarber1(a)ualberta.ca>
Gerrit-MessageType: newchange
Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/34849 )
Change subject: print: Fix vendor string memory leak
......................................................................
print: Fix vendor string memory leak
Freeing this string won't really matter in the incredible case that we
run out of memory, but it keeps Coverity happy.
Change-Id: I962d2f2227850473b70272bc48b3fc0a0fb11342
Signed-off-by: Jacob Garber <jgarber1(a)ualberta.ca>
Found-by: Coverity CID 1403822
---
M print.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/49/34849/1
diff --git a/print.c b/print.c
index 2901c50..91e5ae5 100644
--- a/print.c
+++ b/print.c
@@ -184,6 +184,7 @@
dev = malloc(strlen(chip->name) + 1);
if (dev == NULL) {
msg_gerr("Out of memory!\n");
+ free(ven);
return 1;
}
strcpy(dev, chip->name);
--
To view, visit https://review.coreboot.org/c/flashrom/+/34849
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I962d2f2227850473b70272bc48b3fc0a0fb11342
Gerrit-Change-Number: 34849
Gerrit-PatchSet: 1
Gerrit-Owner: Jacob Garber <jgarber1(a)ualberta.ca>
Gerrit-MessageType: newchange
Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/34847 )
Change subject: linux_mtd: Fix param memory leak
......................................................................
linux_mtd: Fix param memory leak
extract_programmer_param() stores allocated memory in param, so make
sure it is freed at the end of the function.
Change-Id: I363e66b49c1ed4034ac058b94a938c8bb197e048
Signed-off-by: Jacob Garber <jgarber1(a)ualberta.ca>
Found-by: Coverity CID 1403823
---
M linux_mtd.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/47/34847/1
diff --git a/linux_mtd.c b/linux_mtd.c
index ae8bef2..d2df95e 100644
--- a/linux_mtd.c
+++ b/linux_mtd.c
@@ -404,5 +404,6 @@
ret = 0;
linux_mtd_init_exit:
+ free(param);
return ret;
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/34847
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I363e66b49c1ed4034ac058b94a938c8bb197e048
Gerrit-Change-Number: 34847
Gerrit-PatchSet: 1
Gerrit-Owner: Jacob Garber <jgarber1(a)ualberta.ca>
Gerrit-MessageType: newchange
Hello David Hendricks,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/flashrom/+/34689
to review the following change.
Change subject: use JEDEC_SE as the default sector erase opcode for ICH southbridge
......................................................................
use JEDEC_SE as the default sector erase opcode for ICH southbridge
Note: We should definitely look into on-the-fly opcode reprogramming
as the comment in ich_spi_send_multicommand() suggests.
Review URL: http://codereview.chromium.org/3239001
Change-Id: I379549e8fa966e75e3d8b7932700df62cf50df64
Signed-off-by: Mayur Panchal <panchalm(a)google.com>
---
M ichspi.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/89/34689/1
diff --git a/ichspi.c b/ichspi.c
index 8b8f0f6..fc61262 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -324,7 +324,7 @@
{
{JEDEC_BYTE_PROGRAM, SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS, 0}, // Write Byte
{JEDEC_READ, SPI_OPCODE_TYPE_READ_WITH_ADDRESS, 0}, // Read Data
- {JEDEC_BE_D8, SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS, 0}, // Erase Sector
+ {JEDEC_SE, SPI_OPCODE_TYPE_WRITE_WITH_ADDRESS, 0}, // Erase Sector
{JEDEC_RDSR, SPI_OPCODE_TYPE_READ_NO_ADDRESS, 0}, // Read Device Status Reg
{JEDEC_REMS, SPI_OPCODE_TYPE_READ_WITH_ADDRESS, 0}, // Read Electronic Manufacturer Signature
{JEDEC_WRSR, SPI_OPCODE_TYPE_WRITE_NO_ADDRESS, 0}, // Write Status Register
--
To view, visit https://review.coreboot.org/c/flashrom/+/34689
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I379549e8fa966e75e3d8b7932700df62cf50df64
Gerrit-Change-Number: 34689
Gerrit-PatchSet: 1
Gerrit-Owner: Mayur Panchal <panchalm(a)google.com>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-MessageType: newchange