From 479ac5260e7ea717f1ea7b1e74dfe807d3b46eda Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Thu, 2 Apr 2026 17:35:53 -0700 Subject: [PATCH] objtool/klp: Fix XXH3 state memory leak The XXH3 state allocated in checksum_init() is never freed. Free it in checksum_finish(). Acked-by: Song Liu Reviewed-by: Miroslav Benes Signed-off-by: Josh Poimboeuf --- tools/objtool/include/objtool/checksum.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/objtool/include/objtool/checksum.h b/tools/objtool/include/objtool/checksum.h index 7fe21608722a..0bd16fe9168b 100644 --- a/tools/objtool/include/objtool/checksum.h +++ b/tools/objtool/include/objtool/checksum.h @@ -26,6 +26,7 @@ static inline void checksum_finish(struct symbol *func) { if (func && func->csum.state) { func->csum.checksum = XXH3_64bits_digest(func->csum.state); + XXH3_freeState(func->csum.state); func->csum.state = NULL; } }