[PATCH v2 13/53] objtool/klp: Fix XXH3 state memory leak
From: Josh Poimboeuf
Date: Fri May 01 2026 - 00:14:03 EST
The XXH3 state allocated in checksum_init() is never freed. Free it in
checksum_finish().
Acked-by: Song Liu <song@xxxxxxxxxx>
Reviewed-by: Miroslav Benes <mbenes@xxxxxxx>
Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
---
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;
}
}
--
2.53.0