Advertisement
Guest User

patch for ls-wvl: Module alloc size check

a guest
Mar 3rd, 2013
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. --- a/kernel/module.c
  2. +++ b/kernel/module.c
  3. @@ -2322,12 +2322,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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement