Skip to content

Commit 08cfeac

Browse files
committed
CRIS: Add configuration possibility for using kmalloc for modules.
Using kmalloc instead of vmalloc solves the stability problems experienced by some 100 LX products.
1 parent b4945a9 commit 08cfeac

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎arch/cris/kernel/module.c‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,28 @@
2828
#define DEBUGP(fmt , ...)
2929
#endif
3030

31+
#ifdef CONFIG_ETRAX_KMALLOCED_MODULES
32+
#define MALLOC_MODULE(size) kmalloc(size, GFP_KERNEL)
33+
#define FREE_MODULE(region) kfree(region)
34+
#else
35+
#define MALLOC_MODULE(size) vmalloc_exec(size)
36+
#define FREE_MODULE(region) vfree(region)
37+
#endif
38+
3139
void *module_alloc(unsigned long size)
3240
{
3341
if (size == 0)
3442
return NULL;
35-
return vmalloc_exec(size);
43+
return MALLOC_MODULE(size);
3644
}
3745

3846

3947
/* Free memory returned from module_alloc */
4048
void module_free(struct module *mod, void *module_region)
4149
{
42-
vfree(module_region);
50+
FREE_MODULE(module_region);
4351
/* FIXME: If module_region == mod->init_region, trim exception
44-
table entries. */
52+
table entries. */
4553
}
4654

4755
/* We don't need anything special. */

0 commit comments

Comments
 (0)