[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z_QXURMplbCtx-YB@gmail.com>
Date: Mon, 7 Apr 2025 20:20:01 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Malaya Kumar Rout <malayarout91@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, Shuah Khan <shuah@...nel.org>,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v2] selftests/x86/lam: fix resource leak in do_uring()
and allocate_dsa_pasid()
* Malaya Kumar Rout <malayarout91@...il.com> wrote:
> @@ -1189,9 +1191,10 @@ void *allocate_dsa_pasid(void)
>
> wq = mmap(NULL, 0x1000, PROT_WRITE,
> MAP_SHARED | MAP_POPULATE, fd, 0);
> - if (wq == MAP_FAILED)
> + if (wq == MAP_FAILED){
> + close(fd);
> perror("mmap");
We should unconditionally close 'fd' after the mmap() call, not just in
the perror() branch.
Thanks,
Ingo
Powered by blists - more mailing lists