summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--flashrom.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/flashrom.c b/flashrom.c
index bd34676f2..dd443b934 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1098,7 +1098,8 @@ int read_flash_to_file(struct flashctx *flash, const char *filename)
goto out_free;
}
- ret = write_buf_to_file(buf, size, filename);
+ if (filename)
+ ret = write_buf_to_file(buf, size, filename);
out_free:
free(buf);
msg_cinfo("%s.\n", ret ? "FAILED" : "done");