summaryrefslogtreecommitdiff
path: root/lib/decompress_unlzma.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-10-01 11:20:33 +0200
committerIngo Molnar <mingo@elte.hu>2009-10-01 11:20:48 +0200
commit0aa73ba1c4e1ad1d51a29e0df95ccd9f746918b6 (patch)
treef0714ddcd02812b4fbe3b5405df9e4068f5587e2 /lib/decompress_unlzma.c
parent925936ebf35a95c290e010b784c962164e6728f3 (diff)
parent33974093c024f08caadd2fc71a83bd811ed1831d (diff)
Merge branch 'tracing/urgent' into tracing/core
Merge reason: Pick up latest fixes and update to latest upstream. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'lib/decompress_unlzma.c')
-rw-r--r--lib/decompress_unlzma.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/decompress_unlzma.c b/lib/decompress_unlzma.c
index 0b954e04bd30..ca82fde81c8f 100644
--- a/lib/decompress_unlzma.c
+++ b/lib/decompress_unlzma.c
@@ -82,6 +82,11 @@ struct rc {
#define RC_MODEL_TOTAL_BITS 11
+static int nofill(void *buffer, unsigned int len)
+{
+ return -1;
+}
+
/* Called twice: once at startup and once in rc_normalize() */
static void INIT rc_read(struct rc *rc)
{
@@ -97,7 +102,10 @@ static inline void INIT rc_init(struct rc *rc,
int (*fill)(void*, unsigned int),
char *buffer, int buffer_size)
{
- rc->fill = fill;
+ if (fill)
+ rc->fill = fill;
+ else
+ rc->fill = nofill;
rc->buffer = (uint8_t *)buffer;
rc->buffer_size = buffer_size;
rc->buffer_end = rc->buffer + rc->buffer_size;