title: Loadable Kernel Module: Unknown symbol malloc_sizes (err 0)
body: <p>I have developed a Loadable Kernel Module (LKM) for android.</p>
  
  <p>I use <code>kzalloc</code>:</p>
  
  <pre><code>device = kzalloc(ndevices * sizeof (*device), GFP_KERNEL);
  </code></pre>
  
  <p>and it worked for a while, but after an update of my android (since 4.1 it's no more working), I got following error on <code>insmod</code>:</p>
  
  <pre><code>insmod module.ko
  insmod: init_module 'module.ko' failed (No such file or directory)
  
  DMESG says:
  Unknown symbol malloc_sizes (err 0)
  </code></pre>
  
  <p>This has something to do with <code>inux/slab.h</code>, that's what I know. </p>
  
  <p>I googled for days over days and I'm very frustrated not finding the solution to fix this problem and get the LKM working again.</p>
  
  <p>Can maybe anyone help me out?</p>
  
  <p>CONCLUSION:</p>
  
  <p>The accepted answer is correct: Try to remove the slab.h and define the missing methods as "extern". Or in your kernel-source, use "make menuconfig" and change SLAB to SLUB (see first comment in answer for more details).</p>
  
  <p>The remaining problems are handled in a new, more specific topic:</p>
  
  <p><a href="https://stackoverflow.com/questions/14241174/interchangeability-of-compiled-lkms">Interchangeability of compiled LKMs</a></p>