Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib/xz: Move s->lzma.len = 0 initialization to lzma_reset()

It's a more logical place even if the resetting needs to be done
only once per LZMA2 stream (if lzma_reset() called in the middle
of an LZMA2 stream, .len will already be 0).

Link: https://lore.kernel.org/r/20211010213145.17462-4-xiang@kernel.org
Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

authored by

Lasse Collin and committed by
Gao Xiang
a98a2540 4f8d7aba

+1 -2
+1 -2
lib/xz/xz_dec_lzma2.c
··· 791 791 s->lzma.rep1 = 0; 792 792 s->lzma.rep2 = 0; 793 793 s->lzma.rep3 = 0; 794 + s->lzma.len = 0; 794 795 795 796 /* 796 797 * All probabilities are initialized to the same value. This hack ··· 1174 1173 } 1175 1174 } 1176 1175 } 1177 - 1178 - s->lzma.len = 0; 1179 1176 1180 1177 s->lzma2.sequence = SEQ_CONTROL; 1181 1178 s->lzma2.need_dict_reset = true;