From michal@isc.org Tue Sep 28 16:15:40 2021 Received: from mx.pao1.isc.org ([149.20.64.53]) by stoneboat.default.lvansomeren.uk0.bigv.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVEpT-0002aF-Ji for yaffs@stoneboat.aleph1.co.uk; Tue, 28 Sep 2021 16:15:40 +0100 Received: from zimbrang.isc.org (zimbrang.isc.org [149.20.1.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx.pao1.isc.org (Postfix) with ESMTPS id 2D70E3AB01F for ; Tue, 28 Sep 2021 15:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=isc.org; s=ostpay; t=1632842133; bh=BOYYxIjH+J/1i6f32fXk5DwcsrpC68w97ET1K8h5uCI=; h=From:To:Subject:Date; b=XSnv4drGe/TWaan+dV15aHiyApEZuaC2tMVltsqkQE6Ozap389BAILZOoIrETIFkY L34zOl6+oTXFEnWFFhM+owmtq9zhSuuLxoCyrFgNTbEIhqB1jcDnU6KE4tndhv7ANa ZrXOreDxoULFhj/W9RBFxBo2adg8tAu58zV5+pPQ= Received: from zimbrang.isc.org (localhost.localdomain [127.0.0.1]) by zimbrang.isc.org (Postfix) with ESMTPS id 2546AEC914A for ; Tue, 28 Sep 2021 15:15:33 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbrang.isc.org (Postfix) with ESMTP id EF6B6EC914C for ; Tue, 28 Sep 2021 15:15:32 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.10.3 zimbrang.isc.org EF6B6EC914C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isc.org; s=05DFB016-56A2-11EB-AEC0-15368D323330; t=1632842133; bh=II6t74lvzQr3wGStTQemxsBMCgS/KMzGNKhR7O3uz+I=; h=From:To:Date:Message-Id:MIME-Version; b=eQpd3frhDwwyZjTFoDvXJaLuO3smPhrXhLV+S6Vn9cxrd8idmRGL1OmTHPSGMUFiB e4BCy/HtClLiA4LB7+JUh78i2gLY+06vsRV9Ut8OvriZ9VDJQG2UIYj0Yjum8PuNRl y2yPimVrgJXWN6c2HgHOPNddIRcF+3cLxENBZeHU= Received: from zimbrang.isc.org ([127.0.0.1]) by localhost (zimbrang.isc.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id dlJLU1KRHHDL for ; Tue, 28 Sep 2021 15:15:32 +0000 (UTC) Received: from larwa.hq.kempniu.pl (user-5-173-136-126.play-internet.pl [5.173.136.126]) by zimbrang.isc.org (Postfix) with ESMTPSA id EA369EC914A for ; Tue, 28 Sep 2021 15:15:31 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: yaffs@stoneboat.aleph1.co.uk Date: Tue, 28 Sep 2021 17:15:24 +0200 Message-Id: <20210928151524.15482-1-michal@isc.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam_score: -7.1 X-Spam_score_int: -70 X-Spam_bar: ------- X-Spam_report: Spam detection software, running on the system "stoneboat.default.lvansomeren.uk0.bigv.io", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: yaffs_endian_config() allocates a buffer (dev->tn_swap_buffer) for the purpose of converting tnodes between little-endian and big-endian byte orders when necessary. This buffer is never released. Add [...] Content analysis details: (-7.1 points, 4.9 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [149.20.64.53 listed in wl.mailspike.net] -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [149.20.64.53 listed in list.dnswl.org] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-ACL-Warn: warn X-SA-Exim-Connect-IP: 149.20.64.53 X-SA-Exim-Mail-From: michal@isc.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on stoneboat.default.lvansomeren.uk0.bigv.io X-Spam-Level: X-Spam-Status: No, score=-7.1 required=4.9 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.2 X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on stoneboat.default.lvansomeren.uk0.bigv.io) Subject: [Yaffs] [PATCH] Free dev->tn_swap_buffer upon deinitialization X-BeenThere: yaffs@stoneboat.aleph1.co.uk X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion of YAFFS NAND flash filesystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2021 15:15:40 -0000 yaffs_endian_config() allocates a buffer (dev->tn_swap_buffer) for the purpose of converting tnodes between little-endian and big-endian byte orders when necessary. This buffer is never released. Add a new function, yaffs_endian_deinit(), which is a cleanup counterpart of yaffs_endian_config(). Call the new function upon deinitialization so that dev->tn_swap_buffer gets released. Signed-off-by: Micha=C5=82 K=C4=99pie=C5=84 --- yaffs_endian.c | 5 +++++ yaffs_endian.h | 1 + yaffs_guts.c | 1 + 3 files changed, 7 insertions(+) diff --git a/yaffs_endian.c b/yaffs_endian.c index 6103f4e..2870d6c 100644 --- a/yaffs_endian.c +++ b/yaffs_endian.c @@ -103,3 +103,8 @@ void yaffs_endian_config(struct yaffs_dev *dev) if (dev->swap_endian) dev->tn_swap_buffer =3D kmalloc(dev->tnode_size, GFP_NOFS); } + +void yaffs_endian_deinit(struct yaffs_dev *dev) { + if (dev->swap_endian) + kfree(dev->tn_swap_buffer); +} diff --git a/yaffs_endian.h b/yaffs_endian.h index 8c27189..068f10d 100644 --- a/yaffs_endian.h +++ b/yaffs_endian.h @@ -50,5 +50,6 @@ void yaffs_do_endian_oh(struct yaffs_dev *dev, struct y= affs_obj_hdr *oh); void yaffs_do_endian_packed_tags2(struct yaffs_dev *dev, struct yaffs_packed_tags2_tags_only *ptt); void yaffs_endian_config(struct yaffs_dev *dev); +void yaffs_endian_deinit(struct yaffs_dev *dev); =20 #endif diff --git a/yaffs_guts.c b/yaffs_guts.c index 3e33916..6fba922 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -4814,6 +4814,7 @@ void yaffs_deinitialise(struct yaffs_dev *dev) yaffs_deinit_tnodes_and_objs(dev); yaffs_summary_deinit(dev); yaffs_cache_deinit(dev); + yaffs_endian_deinit(dev); =20 kfree(dev->gc_cleanup_list); =20 --=20 2.33.0