[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250114082650.113105-1-liuye@kylinos.cn>
Date: Tue, 14 Jan 2025 16:26:50 +0800
From: liuye <liuye@...inos.cn>
To: tglx@...utronix.de,
mingo@...hat.com,
bp@...en8.de,
dave.hansen@...ux.intel.com,
shuah@...nel.org,
x86@...nel.org
Cc: hpa@...or.com,
linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org,
liuye <liuye@...inos.cn>
Subject: [PATCH] selftests/x86/lam: Fix Memory leak fi in do_uring
Exception branch returns without free fi.
Signed-off-by: liuye <liuye@...inos.cn>
---
tools/testing/selftests/x86/lam.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/x86/lam.c b/tools/testing/selftests/x86/lam.c
index 0ea4f6813930..74f422e76dce 100644
--- a/tools/testing/selftests/x86/lam.c
+++ b/tools/testing/selftests/x86/lam.c
@@ -596,8 +596,10 @@ int do_uring(unsigned long lam)
fi->file_fd = file_fd;
ring = malloc(sizeof(*ring));
- if (!ring)
+ if (!ring) {
+ free(fi);
return 1;
+ }
memset(ring, 0, sizeof(struct io_ring));
--
2.25.1
Powered by blists - more mailing lists