wok-next diff linux/stuff/linux-lzma-export.u @ rev 4389
mbclient, fix DEPENDS
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Thu Oct 15 19:45:07 2009 +0000 (2009-10-15) |
parents | 28bd53ce3a11 |
children |
line diff
1.1 --- a/linux/stuff/linux-lzma-export.u Sun Mar 02 23:16:29 2008 +0000 1.2 +++ b/linux/stuff/linux-lzma-export.u Thu Oct 15 19:45:07 2009 +0000 1.3 @@ -1,6 +1,6 @@ 1.4 --- linux-2.6.24.2/lib/decompress_unlzma.c 1.5 +++ linux-2.6.24.2/lib/decompress_unlzma.c 1.6 -@@ -52,11 +52,6 @@ static void __init large_free(void *wher 1.7 +@@ -52,16 +52,6 @@ 1.8 } 1.9 1.10 #ifndef TEST 1.11 @@ -9,19 +9,29 @@ 1.12 - return kmalloc(size, GFP_KERNEL); 1.13 -} 1.14 - 1.15 - static void __init free(void *where) 1.16 +-static void __init free(void *where) 1.17 +-{ 1.18 +- kfree(where); 1.19 +-} 1.20 +- 1.21 + static void __init error(char *x) 1.22 { 1.23 - kfree(where); 1.24 -@@ -321,7 +316,7 @@ typedef struct { 1.25 - #define LZMA_LITERAL (LZMA_REP_LEN_CODER + LZMA_NUM_LEN_PROBS) 1.26 + printk(KERN_ERR "%s\n", x); 1.27 +@@ -166,13 +156,6 @@ 1.28 + } 1.29 + } 1.30 1.31 - 1.32 --STATIC int unlzma(char *inbuf, int in_len, 1.33 -+int unlzma(char *inbuf, int in_len, 1.34 - int(*fill)(void*,unsigned int), 1.35 - int(*writebb)(char*,unsigned int), 1.36 - int *posp) 1.37 -@@ -348,10 +343,21 @@ STATIC int unlzma(char *inbuf, int in_le 1.38 +- 1.39 +-/* Called once. TODO: bb_maybe_free() */ 1.40 +-static always_inline void rc_free(rc_t * rc) 1.41 +-{ 1.42 +- free(rc->buffer); 1.43 +-} 1.44 +- 1.45 + /* Called twice, but one callsite is in speed_inline'd rc_is_bit_0_helper() */ 1.46 + static void rc_do_normalize(rc_t * rc) 1.47 + { 1.48 +@@ -348,10 +331,22 @@ 1.49 1.50 rc_init(&rc, fill, inbuf, in_len); 1.51 1.52 @@ -30,14 +40,15 @@ 1.53 - rc_read(&rc); 1.54 - ((unsigned char *)&header)[i] = *rc.ptr++; 1.55 + header.dict_size = header.dst_size = in_len; 1.56 -+ if (inbuf && inbuf[0] == 0) { 1.57 ++ if (inbuf && in_len > 0 && inbuf[0] == 0) { 1.58 + const int LZMA_LC = 3, LZMA_LP = 0, LZMA_PB = 2; 1.59 + header.pos = (LZMA_PB * 45) + (LZMA_LP * 5) + LZMA_LC; 1.60 + rc.ptr++; 1.61 + } 1.62 + else { 1.63 + int hdrsize = sizeof(header); 1.64 -+ if (inbuf && (1 + * (unsigned long *) &inbuf[9]) > 1U) 1.65 ++ if (inbuf && in_len > 12 && 1.66 ++ (1 + * (unsigned long *) &inbuf[9]) > 1U) 1.67 + hdrsize = 5; 1.68 + for (i = 0; i < hdrsize; i++) { 1.69 + if (rc.ptr >= rc.buffer_end)