diff options
author | Lasse Collin <[email protected]> | 2011-01-12 17:01:17 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2011-01-13 08:03:24 -0800 |
commit | 278208d9d631524d04152574f87b9b88919ce663 (patch) | |
tree | ee50d75ba3589c76b45525a8b0c30eb85d6634a7 /tools/perf/util/trace-event-scripting.c | |
parent | 8218a437234309faa5725f82c33c3523788d5f68 (diff) |
Decompressors: check for read errors in decompress_unlzma.c
Return value of rc->fill() is checked in rc_read() and error() is called
when needed, but then the code continues as if nothing had happened.
rc_read() is a void function and it's on the top of performance critical
call stacks, so propagating the error code via return values doesn't sound
like the best fix. It seems better to check rc->buffer_size (which holds
the return value of rc->fill()) in the main loop. It does nothing bad
that the code runs a little with unknown data after a failed rc->fill().
This fixes an infinite loop in initramfs decompression if the
LZMA-compressed initramfs image is corrupt.
Signed-off-by: Lasse Collin <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Alain Knaff <[email protected]>
Cc: Albin Tonnerre <[email protected]>
Cc: Phillip Lougher <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions