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 D464FC6FD1D for ; Thu, 30 Mar 2023 12:37:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 06AC885E83; Thu, 30 Mar 2023 14:36:30 +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 A38C585738; Thu, 30 Mar 2023 06:20:46 +0200 (CEST) Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) (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 7ABD885D4A for ; Thu, 30 Mar 2023 06:20:40 +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: bizesmtp81t1680150035tcekgouv Received: from ubuntu.. ( [111.196.129.125]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 30 Mar 2023 12:20:34 +0800 (CST) X-QQ-SSF: 01200000000000D0E000000A0000000 X-QQ-FEAT: C46Rb8GPIEeJRaQ+qdQYSq4Q5jPUh481fkFIggrWZoIF5lc5e+rIVNEBZRnIh I5kBVuflKbJkX5ypJSv7yjgTim+RLUTRSUOdt2SlWrIZ2aP8iv7JGEmq0VUTX7xcQN7o6Tr XcDUecYLrzz6noHAkBbco0drtpklTqqGVHcEQV8pKn9DlQ9DTeoUcWBcIQNCOhKagHM2w1N Kv+X4iZBQZHS5YVx2W8XeKSHlKzP2q+uDn8DPyaTnTEHSBSTsN4itwMfGEaLvRHe0aIWfHH Z1kdA4COrCfR5fN4tEk5+1pc/CFGDw/NWOR3HXnoP88xGse5YuRHhY0Rltw9wifrMJMh7A3 0cssKl1+6gFmvBvsd/tGzDzCzyCzCbJCQvKIDXI X-QQ-GoodBg: 0 X-BIZMAIL-ID: 5140976987743705372 From: Bin Meng To: u-boot@lists.denx.de Cc: Leo , Rick Chen Subject: [PATCH 4/8] tools: prelink-riscv: Unmap the ELF image when done Date: Thu, 30 Mar 2023 12:20:20 +0800 Message-Id: <20230330042024.721710-4-bmeng@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230330042024.721710-1-bmeng@tinylab.org> References: <20230330042024.721710-1-bmeng@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvr:qybglogicsvr3 X-Mailman-Approved-At: Thu, 30 Mar 2023 14:36:20 +0200 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 --- 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