[kernel/2.6.38] fix gcc-4.6 set but unused warnings
[openwrt.git] / target / linux / generic / patches-3.2 / 340-module_alloc_size_check.patch
1 --- a/kernel/module.c
2 +++ b/kernel/module.c
3 @@ -2283,12 +2283,15 @@ static void dynamic_debug_remove(struct
4
5 void * __weak module_alloc(unsigned long size)
6 {
7 - return size == 0 ? NULL : vmalloc_exec(size);
8 + return vmalloc_exec(size);
9 }
10
11 static void *module_alloc_update_bounds(unsigned long size)
12 {
13 - void *ret = module_alloc(size);
14 + void *ret = NULL;
15 +
16 + if (size)
17 + ret = module_alloc(size);
18
19 if (ret) {
20 mutex_lock(&module_mutex);
This page took 0.049144 seconds and 5 git commands to generate.