debug_kmemleak.c 465 B

1234567891011121314151617181920
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * Module kmemleak support
  4. *
  5. * Copyright (C) 2009 Catalin Marinas
  6. */
  7. #include <linux/module.h>
  8. #include <linux/kmemleak.h>
  9. #include "internal.h"
  10. void kmemleak_load_module(const struct module *mod,
  11. const struct load_info *info)
  12. {
  13. /* only scan writable, non-executable sections */
  14. for_each_mod_mem_type(type) {
  15. if (type != MOD_DATA && type != MOD_INIT_DATA)
  16. kmemleak_no_scan(mod->mem[type].base);
  17. }
  18. }