Decompressors: check for write errors in decompress_unlzma.c
Decompressors: check for write errors in decompress_unlzma.c

The return value of wr->flush() is not checked in write_byte().  This
means that the decompressor won't stop even if the caller doesn't want
more data.  This can happen e.g.  with corrupt LZMA-compressed initramfs.
Returning the error quickly allows the user to see the error message
quicker.

There is a similar missing check for wr.flush() near the end of unlzma().

Signed-off-by: Lasse Collin <54c4a333fa12d5afeed41b942e93e34dc37c3466@tukaani.org>
Cc: "H. Peter Anvin" <8a453bad9912ffe59bc0f0b8abe03df9be19379e@zytor.com>
Cc: Alain Knaff <8450103c06dbd58add9d047d761684096ac560ca@knaff.lu>
Cc: Albin Tonnerre <02f45de84d4d61b670a97471f91acfdfa4211a05@free-electrons.com>
Cc: Phillip Lougher <21542e38a0b82113edef7e33c378f247e235fb75@lougher.demon.co.uk>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas