xz: fix XZ_DYNALLOC to avoid useless memory reallocations
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 7 Mar 2022 08:06:31 +0000 (09:06 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 7 Mar 2022 08:06:31 +0000 (09:06 +0100)
commit22d5d1c0d18893d9cb92b322f95d7ebab6c0cfd9
treeb3b5c2e20f20a5c6ba070e00e4ad308507cd210d
parentc9875a8cce8b5e534ec9348a1bf5d6972ec17369
xz: fix XZ_DYNALLOC to avoid useless memory reallocations

s->dict.allocated was initialized to 0 but never set after a successful
allocation, thus the code always thought that the dictionary buffer has
to be reallocated.

Link: http://lkml.kernel.org/r/20191104185107.3b6330df@tukaani.org
Reported-by: Yu Sun <yusun2@cisco.com>
Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Acked-by: Daniel Walker <danielwa@cisco.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 8e20ba2e53fc
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/xz/dec_lzma2.c