You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openwrt/target/linux/generic/patches-3.7/340-module_alloc_size_check...

21 lines
450 B
Diff

--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2378,12 +2378,15 @@ static void dynamic_debug_remove(struct
void * __weak module_alloc(unsigned long size)
{
- return size == 0 ? NULL : vmalloc_exec(size);
+ return vmalloc_exec(size);
}
static void *module_alloc_update_bounds(unsigned long size)
{
- void *ret = module_alloc(size);
+ void *ret = NULL;
+
+ if (size)
+ ret = module_alloc(size);
if (ret) {
mutex_lock(&module_mutex);