[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250324125108.GH14944@noisy.programming.kicks-ass.net>
Date: Mon, 24 Mar 2025 13:51:08 +0100
From: Peter Zijlstra <peterz@...radead.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] selftests/x86/lam: fix memory leak and resource leak in
lam.c
On Mon, Mar 24, 2025 at 06:17:50PM +0530, Malaya Kumar Rout wrote:
> Static Analyis for bench_htab_mem.c with cppcheck:error
> tools/testing/selftests/x86/lam.c:585:3:
> error: Resource leak: file_fd [resourceLeak]
> tools/testing/selftests/x86/lam.c:593:3:
> error: Resource leak: file_fd [resourceLeak]
> tools/testing/selftests/x86/lam.c:600:3:
> error: Memory leak: fi [memleak]
> tools/testing/selftests/x86/lam.c:1066:2:
> error: Resource leak: fd [resourceLeak]
>
> fix the issue by closing the file descriptors and
> releasing the allocated memory.
>
But but but, doesn't the program just exit on any of those 'errors'
anyway?
That is, iirc this is a single shot program.
Powered by blists - more mailing lists