Re: [PATCH] lib: decompress_unxz: fix memory leak of 'in' buffer in single-call mode

From: Lasse Collin

Date: Wed Aug 26 2026 - 14:17:36 EST


The diff is good, but I would like a different commit message because
there was no bug. I wrote a suggestion below. If you think it's OK,
please submit v2 with the same diff and the new commit message to
Andrew Morton. Thanks!

----%<----
lib: decompress_unxz: Make it obvious that there is no memory leak

Calling __decompress() or unxz() with fill == NULL && flush == NULL &&
in == NULL is invalid, thus there were no memory leaks even though it
might have looked like that. Move the conditional free() calls so that
it's obvious that there are no leaks.

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=207113
Link: https://lore.kernel.org/lkml/20241006072542.66442-2-t.v.s10123@xxxxxxxxx/T/
Link: https://lore.kernel.org/lkml/20260825191333.34276-1-skunkolee@xxxxxxxxx/T/
Reviewed-by: Lasse Collin <lasse.collin@xxxxxxxxxxx>
----%<----

--
Lasse Collin