summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2019-06-15 14:56:19 +0200
committerNico Huber <nico.h@gmx.de>2019-06-17 08:32:43 +0000
commit70461a9524fc84ec5c095f11927cffa0429a6267 (patch)
tree0df6b67aec1d936bf8b39a86d5d9ed97ef5aa125 /flashrom.c
parent4f213285d78974c4b8915b311aff88449279f554 (diff)
downloadflashrom-70461a9524fc84ec5c095f11927cffa0429a6267.tar.gz
flashrom-70461a9524fc84ec5c095f11927cffa0429a6267.tar.bz2
flashrom-70461a9524fc84ec5c095f11927cffa0429a6267.zip
layout: Make `romentry.name` a pointer
This should provide more flexibility while we don't have to allocate 256B extra per layout entry. Change-Id: Ibb903113550ec13f43cbbd0a412c8f35fe1cf454 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/33515 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/flashrom.c b/flashrom.c
index d6c4d248d..2d3cd1853 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1338,7 +1338,11 @@ notfound:
fallback->entry.start = 0;
fallback->entry.end = flash->chip->total_size * 1024 - 1;
fallback->entry.included = true;
- strcpy(fallback->entry.name, "complete flash");
+ fallback->entry.name = strdup("complete flash");
+ if (!fallback->entry.name) {
+ msg_cerr("Failed to probe chip: %s\n", strerror(errno));
+ return -1;
+ }
tmp = flashbuses_to_text(flash->chip->bustype);
msg_cinfo("%s %s flash chip \"%s\" (%d kB, %s) ", force ? "Assuming" : "Found",