Commit 7a6fbd69 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix read_dir()

This function tries to allocate increasingly large buffers, but it gets the
bounds wrong by a factor of PAGE_SIZE.  It causes boot-time devfs mounting
to fail.
parent b84ee08e
...@@ -54,7 +54,7 @@ static void * __init read_dir(char *path, int *len) ...@@ -54,7 +54,7 @@ static void * __init read_dir(char *path, int *len)
if (fd < 0) if (fd < 0)
return NULL; return NULL;
for (size = 1 << 9; size <= (1 << MAX_ORDER); size <<= 1) { for (size = 1 << 9; size <= (PAGE_SIZE << MAX_ORDER); size <<= 1) {
void *p = kmalloc(size, GFP_KERNEL); void *p = kmalloc(size, GFP_KERNEL);
int n; int n;
if (!p) if (!p)
......
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