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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36ABDC77B61 for ; Thu, 13 Apr 2023 06:21:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1ED7785DCE; Thu, 13 Apr 2023 08:20:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 18FAC85838; Thu, 13 Apr 2023 08:20:29 +0200 (CEST) Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2178D85A1A for ; Thu, 13 Apr 2023 08:20:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng@tinylab.org X-QQ-mid: bizesmtp73t1681366819ta42uij4 Received: from ubuntu.. ( [111.196.129.125]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 13 Apr 2023 14:20:18 +0800 (CST) X-QQ-SSF: 01200000000000D0F000000A0000000 X-QQ-FEAT: O2PjJ0EwFB+Zx2IV+0UlkFmCzDeSuc4KGS7R+cpRVieKRN47VM69G97o4F+ED RoKoZvZ6tq8Z5fhmURS7vwpTmrFcs3JsV/dbHp9Dk3UlCjEpYFBKfaJZA9wGmwTPD5gBJLT BEW26GJznImqcwm/LI1UI18bE2RhDWaMLDpmVpyZe+/QcS2a6g94Zswr/uO5sWj5GIu3aBD ih0ITvUKWLipK3hI+5nqSGrzG+K4wSWqQ7HwXt2y/OZC+UcLXq33F6fIR1LySkqnfpKofb8 ynVWUoU5tr0/P4R2AIsARims3Q65MYofIcHu6XqIDMltDSc2tOhUKXHy5C4aBGQZ9A3sdPp gMdAdrkLTgOCaZqrPyvqsnvq5rv4e55e7hQjc27 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 4254240754551875476 From: Bin Meng To: u-boot@lists.denx.de Cc: Rick Chen , Leo Subject: [PATCH v2 4/9] tools: prelink-riscv: Unmap the ELF image when done Date: Thu, 13 Apr 2023 14:20:03 +0800 Message-Id: <20230413062008.981238-4-bmeng@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230413062008.981238-1-bmeng@tinylab.org> References: <20230413062008.981238-1-bmeng@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz7a-0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The codes forget to call munmap() to unmap the ELF image that was mapped by previous mmap(). Signed-off-by: Bin Meng Reviewed-by: Rick Chen --- (no changes since v1) tools/prelink-riscv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/prelink-riscv.c b/tools/prelink-riscv.c index b0467949eb..43d6412ee9 100644 --- a/tools/prelink-riscv.c +++ b/tools/prelink-riscv.c @@ -118,5 +118,7 @@ int main(int argc, const char *const *argv) prelink_le32(data); } + munmap(data, st.st_size); + return 0; } -- 2.34.1