From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5B67C433EF for ; Thu, 30 Dec 2021 03:51:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6AAD86B0080; Wed, 29 Dec 2021 22:51:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 659F26B0081; Wed, 29 Dec 2021 22:51:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 522246B0082; Wed, 29 Dec 2021 22:51:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0037.hostedemail.com [216.40.44.37]) by kanga.kvack.org (Postfix) with ESMTP id 43EE96B0080 for ; Wed, 29 Dec 2021 22:51:41 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 03141894AA for ; Thu, 30 Dec 2021 03:51:40 +0000 (UTC) X-FDA: 78973086402.21.C21F2D9 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf30.hostedemail.com (Postfix) with ESMTP id 8C21B80004 for ; Thu, 30 Dec 2021 03:51:40 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7B470615B8; Thu, 30 Dec 2021 03:51:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1020C36AE7; Thu, 30 Dec 2021 03:51:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1640836298; bh=6iM3TbYQjPiJGvmGiMsr01LD0T/mxawhZBX2nGQf1VE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KQeEpUIB4mWIryweMs8qNcZQw55aoYzboRGBsojth6PBbhtKiJcs7DP/3PKEGzirx 1xzkSIoMtu9WCJZB+W0nfBEyiO/oWcQJajiPzaFq5i4/l0RfcXcDZOArWAhIdZDmqo HitRcb5t2UG/R5pQ1QeN56kKXOfmW5m32S7B2+bA= Date: Wed, 29 Dec 2021 19:51:35 -0800 From: Andrew Morton To: Ryan Cai Cc: , , , Subject: Re: [Resource Leak] Missing closing files in testing/selftests/vm/mlock2 Message-Id: <20211229195135.959b3730c54652de497e932b@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 8C21B80004 X-Stat-Signature: ef7xg79tp4b9aom4tj3g7iydio8y1f3x Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=KQeEpUIB; spf=pass (imf30.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1640836300-145595 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 30 Dec 2021 11:17:37 +0800 Ryan Cai wrote: > Dear Kernel maintainers, > =A01. In testing/selftests/vm/mlock2, the file opened at Lin= e 39 may not closed when going to Line 65. > Location: https://github.com/torvalds/linux/blob/5bfc75d92e= fd494db37f5c4c173d3639d4772966/tools/testing/selftests/vm/mlock2.h#L37-L49 That's what exit() does. I don't think we really care unless the leak is inside a loop. That being said, it's untidy and is setting a poor example so I guess we should fix it. > Can I send I a patch? It would be better to just send the patch rather than preceding it with "can I send a patch". Everyone can send a patch and they are encouraged to do so!