diff --git a/tools/lpc.cpp b/tools/lpc.cpp
index d552b6a..2a65379 100644
--- a/tools/lpc.cpp
+++ b/tools/lpc.cpp
@@ -111,18 +111,17 @@
         return false;
     }
 
-    progress->start(fileSize);
-
     /* For Nuvoton the maximum is 4K */
     auto readBuffer = std::make_unique<std::uint8_t[]>(host_lpc_buf.length);
     if (nullptr == readBuffer)
     {
-        progress->abort();
         sys->close(inputFd);
         std::fprintf(stderr, "Unable to allocate memory for read buffer.\n");
         return false;
     }
 
+    progress->start(fileSize);
+
     /* TODO: This is similar to PCI insomuch as how it sends data, so combine.
      */
     try
diff --git a/tools/net.cpp b/tools/net.cpp
index f6a44d8..3f58708 100644
--- a/tools/net.cpp
+++ b/tools/net.cpp
@@ -56,24 +56,19 @@
     constexpr size_t blockSize = 64 * 1024;
     Fd inputFd(std::nullopt, sys);
 
+    inputFd.reset(sys->open(input.c_str(), O_RDONLY));
+    if (*inputFd < 0)
     {
-        inputFd.reset(sys->open(input.c_str(), O_RDONLY));
-        if (*inputFd < 0)
-        {
-            (void)inputFd.release();
-            std::fprintf(stderr, "Unable to open file: '%s'\n", input.c_str());
-            return false;
-        }
+        (void)inputFd.release();
+        std::fprintf(stderr, "Unable to open file: '%s'\n", input.c_str());
+        return false;
+    }
 
-        std::int64_t fileSize = sys->getSize(input.c_str());
-        if (fileSize == 0)
-        {
-            std::fprintf(stderr,
-                         "Zero-length file, or other file access error\n");
-            return false;
-        }
-
-        progress->start(fileSize);
+    std::int64_t fileSize = sys->getSize(input.c_str());
+    if (fileSize == 0)
+    {
+        std::fprintf(stderr, "Zero-length file, or other file access error\n");
+        return false;
     }
 
     Fd connFd(std::nullopt, sys);
@@ -91,7 +86,6 @@
         {
             std::fprintf(stderr, "Couldn't parse address %s with port %s: %s\n",
                          host.c_str(), port.c_str(), gai_strerror(ret));
-            progress->abort();
             return false;
         }
 
@@ -112,7 +106,6 @@
         if (addr == nullptr)
         {
             std::fprintf(stderr, "Failed to connect\n");
-            progress->abort();
             return false;
         }
     }
@@ -122,6 +115,8 @@
         int bytesSent = 0;
         off_t offset = 0;
 
+        progress->start(fileSize);
+
         do
         {
             bytesSent = sys->sendfile(*connFd, *inputFd, &offset, blockSize);
diff --git a/tools/test/tools_net_unittest.cpp b/tools/test/tools_net_unittest.cpp
index 94678f1..c18b842 100644
--- a/tools/test/tools_net_unittest.cpp
+++ b/tools/test/tools_net_unittest.cpp
@@ -56,8 +56,6 @@
         EXPECT_CALL(sysMock, close(inFd)).WillOnce(Return(0));
         EXPECT_CALL(sysMock, getSize(StrEq(filePath.c_str())))
             .WillOnce(Return(fakeFileSize));
-
-        EXPECT_CALL(progMock, start(fakeFileSize));
     }
 
     void expectAddrInfo()
