When downloading to a buffer, download_fd is never assigned a valid file descriptor. We should therefore avoid calling close on the value found in that variable. Signed-off-by: Daniel Glöckner <dg@xxxxxxxxx> --- common/fastboot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/fastboot.c b/common/fastboot.c index 706547309..3fcc69f62 100644 --- a/common/fastboot.c +++ b/common/fastboot.c @@ -347,7 +347,8 @@ int fastboot_handle_download_data(struct fastboot *fb, const void *buffer, void fastboot_download_finished(struct fastboot *fb) { - close(fb->download_fd); + if (!fastboot_download_to_buf(fb)) + close(fb->download_fd); printf("\n"); -- 2.17.1 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox