From nobody Tue Sep 16 23:46:23 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDCB0C4332F for ; Tue, 27 Dec 2022 16:02:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231535AbiL0QCu (ORCPT ); Tue, 27 Dec 2022 11:02:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230209AbiL0QCs (ORCPT ); Tue, 27 Dec 2022 11:02:48 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2F92D73 for ; Tue, 27 Dec 2022 08:02:46 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1672156964; bh=WygJ1LogaMt7MCTVMz5LRPbo5ugX1SmSSa6UqeJvw4g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BoJrCV32q5+ZX9E7hByJLWwo7fCfvpmrC+NI8JWcOJ4OXoeUmNeiVkEBNdl97cP1C fJis5QnFfTipBbfr/kazHgOWmDYa959RnH3GmpbfKBFf9M6NczsoKxwpF+JPI0LJie WZVNrCY9ff0/sfMvuCOLEQSrVuANtVqmphzTycXY= Date: Tue, 27 Dec 2022 16:01:04 +0000 Subject: [PATCH v2 8/8] objtool: explicitly cleanup resources on success MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20221216-objtool-memory-v2-8-17968f85a464@weissschuh.net> References: <20221216-objtool-memory-v2-0-17968f85a464@weissschuh.net> In-Reply-To: <20221216-objtool-memory-v2-0-17968f85a464@weissschuh.net> To: Josh Poimboeuf , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1672156865; l=618; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=WygJ1LogaMt7MCTVMz5LRPbo5ugX1SmSSa6UqeJvw4g=; b=MRmJd1QRpDgL/iIJ/DCBZTdg4HCDjlAvrgtCTCrxDptY+z/uSoHWpLTa0PFHkm8zAL2huAiioeNH ElsMGfVWBLCXo8f9Z0XTYkwtKZVjIAmY8TzWcVqvEtLc+YOAf6Er X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Previously the file was only closed and resources properly freed on errors, not on normal exits. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/objtool/builtin-check.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index 7c175198d09f..e11c766b98ce 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -229,5 +229,7 @@ int objtool_run(int argc, const char **argv) if (file->elf->changed) return elf_write(file->elf); =20 + elf_close(file->elf); + return 0; } --=20 2.39.0