lkml.org 
[lkml]   [2007]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Reduce stack used by lib/hexdump.c

On Nov 29 2007 13:02, Randy Dunlap wrote:
>> @@ -140,13 +140,20 @@ EXPORT_SYMBOL(hex_dump_to_buffer);
>> * Example output using %DUMP_PREFIX_ADDRESS and 4-byte mode:
>> * ffffffff88089af0: 73727170 77767574 7b7a7978 7f7e7d7c pqrstuvwxyz{|}~.
>> */
>> +
>> +#define HEX_LINE_SIZE 200
>> +
>> void print_hex_dump(const char *level, const char *prefix_str, int
>> prefix_type,
>> int rowsize, int groupsize,
>> const void *buf, size_t len, bool ascii)
>> {
>> const u8 *ptr = buf;
>> int i, linelen, remaining = len;
>> - unsigned char linebuf[200];
>> + unsigned char *linebuf;
>> +
>> + linebuf = kmalloc(HEX_LINE_SIZE, GFP_KERNEL);
>> + if (!linebuf) {
>> + WARN_ON(1);
>> + return;
>> + }
>>

I'd add GFP_ATOMIC here. Who knows whether tomorrow, the oops dumper
or warn_on will use print_hex_dump.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-29 22:11    [W:0.053 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site