diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp index 3bfee4e3d90b..a93f80e11805 100644 --- a/lld/COFF/Writer.cpp +++ b/lld/COFF/Writer.cpp @@ -371,9 +371,7 @@ std::error_code Writer::write(StringRef OutputPath) { writeHeader(); writeSections(); applyRelocations(); - if (auto EC = Buffer->commit()) - return EC; - return std::error_code(); + return Buffer->commit(); } } // namespace coff