Print this page
smatch: check libld_* allocation functions

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/smatch_buf_size.c
          +++ new/usr/src/tools/smatch/src/smatch_buf_size.c
↓ open down ↓ 903 lines elided ↑ open up ↑
 904  904                  add_allocation_function("devm_kmalloc", &match_alloc, 1);
 905  905                  add_allocation_function("devm_kzalloc", &match_alloc, 1);
 906  906                  add_allocation_function("krealloc", &match_alloc, 1);
 907  907                  add_allocation_function("__alloc_bootmem", &match_alloc, 0);
 908  908                  add_allocation_function("alloc_bootmem", &match_alloc, 0);
 909  909                  add_allocation_function("kmap", &match_page, 0);
 910  910                  add_allocation_function("get_zeroed_page", &match_page, 0);
 911  911                  add_allocation_function("alloc_pages", &match_alloc_pages, 1);
 912  912                  add_allocation_function("alloc_pages_current", &match_alloc_pages, 1);
 913  913                  add_allocation_function("__get_free_pages", &match_alloc_pages, 1);
      914 +        } else if (option_project == PROJ_ILLUMOS_USER) {
      915 +                add_allocation_function("libld_malloc", &match_alloc, 0);
      916 +                add_allocation_function("libld_realloc", &match_alloc, 1);
      917 +                add_allocation_function("libld_calloc", &match_calloc, 0);
 914  918          }
 915  919  
 916  920          add_allocation_function("strndup", match_strndup, 0);
 917  921          if (option_project == PROJ_KERNEL)
 918  922                  add_allocation_function("kstrndup", match_strndup, 0);
 919  923  
 920  924          add_modification_hook(my_size_id, &set_size_undefined);
 921  925  
 922  926          add_merge_hook(my_size_id, &merge_size_func);
 923  927  
↓ open down ↓ 12 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX