Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3377494rwl; Tue, 27 Dec 2022 08:15:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXsUyn6NzZD21fqoCWGz9Fclty83fpki2fmNQg3N3BVTvBNMMWYmG1HOAFFfEJa3viJoZN9p X-Received: by 2002:a05:6a20:2d0d:b0:a3:f233:c35 with SMTP id g13-20020a056a202d0d00b000a3f2330c35mr30155291pzl.52.1672157759650; Tue, 27 Dec 2022 08:15:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672157759; cv=none; d=google.com; s=arc-20160816; b=K2oYNLjHF9zQvPDfWBHhxbha7vXFXfNZi2KIcNbC1yd1dg3gZNS/IHTYEuOBsZgdoe Jq6mdtof3wK9Vm7w/PaP+ujwklrdQZ9KhoIlm/pfMKiZPm+UzrL3ZJATuUZp/N7R6J8S zvtXrmq+26xKMJesUsuKqGbCTJekHTaTYZweoTyVnUszd8jYFjTe2UxYKDZiC/ZZLxEI oPtjYnv/UDhLtmYsfRYyjc9SR26W/Ycab1zOv155ZCE+sAKfaebhS2pE7J5glBdMFzjq T4TK71BpPfoICdzo/1GCOCNYSgg0Ltw68akmvVfgDHW0sud5DyJj7iyObPBMPW8qS4rC cIsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:dkim-signature :from; bh=bFPA0IBIJaEy2/voRS0odpOtzEbW+juo7gl60jGTTD4=; b=hUCDbVJYXKjp4V6YjwF740Nh/xW2ZYdIsZL2RmgaioMcULpa4JlMArO7fMPvIeDvtv QtECcyUNvH+bJzNhUZhBbMBCoqZ/uOrTwc1LoBK7erihAnHzDUIM20GJSaDW5SVOOVIJ BketARsFl8JrklPEefLk3O8lzgfRHHQonMXs6vVWmXgujgDHF6zyN6WDtTTb/B2YBPIv 8yUQQdPbQsp3cBZEIURyQxx257cVgltKACoIwtNVK6Gm3C+l3x3GDEv+wxXqPvfrCluz oVi+Epqs6zV7QTvf5YrDCDQySBi+YGpR6F6FJjbqhae3pIb4jQKvRAt70w0BkdfKheHj hGnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=BoJrCV32; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e21-20020a637455000000b00478d123064dsi15470614pgn.663.2022.12.27.08.15.50; Tue, 27 Dec 2022 08:15:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=BoJrCV32; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231298AbiL0QCt (ORCPT + 67 others); Tue, 27 Dec 2022 11:02:49 -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: 8bit 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= X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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ßschuh --- 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); + elf_close(file->elf); + return 0; } -- 2.39.0