projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46da276
)
flex_array: fix the panic when calling flex_array_alloc() without __GFP_ZERO
author
Changli Gao
<
[email protected]
>
Fri, 23 Apr 2010 17:17:45 +0000
(13:17 -0400)
committer
Linus Torvalds
<
[email protected]
>
Sat, 24 Apr 2010 18:31:24 +0000
(11:31 -0700)
memset() is called with the wrong address and the kernel panics.
Signed-off-by: Changli Gao <
[email protected]
>
Cc: Patrick McHardy <
[email protected]
>
Acked-by: David Rientjes <
[email protected]
>
Cc: <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
lib/flex_array.c
patch
|
blob
|
history
diff --git
a/lib/flex_array.c
b/lib/flex_array.c
index 66eef2e4483ea50caaecd2afd1e8ca652e5e28d0..41b1804fa728a6cb6d38abd66ce1e71bb05eb1b6 100644
(file)
--- a/
lib/flex_array.c
+++ b/
lib/flex_array.c
@@
-99,7
+99,7
@@
struct flex_array *flex_array_alloc(int element_size, unsigned int total,
ret->element_size = element_size;
ret->total_nr_elements = total;
if (elements_fit_in_base(ret) && !(flags & __GFP_ZERO))
- memset(ret->parts[0], FLEX_ARRAY_FREE,
+ memset(
&
ret->parts[0], FLEX_ARRAY_FREE,
FLEX_ARRAY_BASE_BYTES_LEFT);
return ret;
}