Commit dd21e9bd authored by Prarit Bhargava's avatar Prarit Bhargava Committed by Linus Torvalds

lib/decompress_bunzip2.c: fix checkstack warning

Fix checkstack error:

lib/decompress_bunzip2.c: In function `get_next_block':
lib/decompress_bunzip2.c:511: warning: the frame size of 1932 bytes is larger than 1024 bytes

byteCount, symToByte, and mtfSymbol cannot be declared static or allocated
dynamically so place them in the bunzip_data struct.
Signed-off-by: default avatarPrarit Bhargava <prarit@redhat.com>
Cc: Phillip Lougher <phillip@lougher.demon.co.uk>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5bf2b193
...@@ -107,6 +107,8 @@ struct bunzip_data { ...@@ -107,6 +107,8 @@ struct bunzip_data {
unsigned char selectors[32768]; /* nSelectors = 15 bits */ unsigned char selectors[32768]; /* nSelectors = 15 bits */
struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */ struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */
int io_error; /* non-zero if we have IO error */ int io_error; /* non-zero if we have IO error */
int byteCount[256];
unsigned char symToByte[256], mtfSymbol[256];
}; };
...@@ -158,14 +160,16 @@ static int INIT get_next_block(struct bunzip_data *bd) ...@@ -158,14 +160,16 @@ static int INIT get_next_block(struct bunzip_data *bd)
int *base = NULL; int *base = NULL;
int *limit = NULL; int *limit = NULL;
int dbufCount, nextSym, dbufSize, groupCount, selector, int dbufCount, nextSym, dbufSize, groupCount, selector,
i, j, k, t, runPos, symCount, symTotal, nSelectors, i, j, k, t, runPos, symCount, symTotal, nSelectors, *byteCount;
byteCount[256]; unsigned char uc, *symToByte, *mtfSymbol, *selectors;
unsigned char uc, symToByte[256], mtfSymbol[256], *selectors;
unsigned int *dbuf, origPtr; unsigned int *dbuf, origPtr;
dbuf = bd->dbuf; dbuf = bd->dbuf;
dbufSize = bd->dbufSize; dbufSize = bd->dbufSize;
selectors = bd->selectors; selectors = bd->selectors;
byteCount = bd->byteCount;
symToByte = bd->symToByte;
mtfSymbol = bd->mtfSymbol;
/* Read in header signature and CRC, then validate signature. /* Read in header signature and CRC, then validate signature.
(last block signature means CRC is for whole file, return now) */ (last block signature means CRC is for whole file, return now) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment