From 33443f6177621ad667dde7954b16e2dc3377ba0f Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Tue, 24 Mar 2009 15:59:55 +0000 Subject: Do not define the debug flags if CONFIG_SLUB is not set. Some versions of the kernel (2.6.18-92.1.22.el5) have patches in them to panic if a slab cache is created with unsupported flags. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6237 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wctc4xxp/base.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'drivers/dahdi/wctc4xxp') diff --git a/drivers/dahdi/wctc4xxp/base.c b/drivers/dahdi/wctc4xxp/base.c index 103d479..17d124f 100644 --- a/drivers/dahdi/wctc4xxp/base.c +++ b/drivers/dahdi/wctc4xxp/base.c @@ -3717,15 +3717,23 @@ static struct pci_driver wctc4xxp_driver = { static int __init wctc4xxp_init(void) { int res; + unsigned long cache_flags; + +#if defined(CONFIG_SLUB) && (LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 22)) + cache_flags = SLAB_HWCACHE_ALIGN | SLAB_STORE_USER | SLAB_DEBUG_FREE; +#else + cache_flags = SLAB_HWCACHE_ALIGN; +#endif + #ifdef USE_CUSTOM_MEMCACHE cmd_cache = my_cache_create(); #else # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) cmd_cache = kmem_cache_create(THIS_MODULE->name, sizeof(struct tcb), - 0, SLAB_HWCACHE_ALIGN | SLAB_STORE_USER | SLAB_DEBUG_FREE, NULL, NULL); + 0, cache_flags, NULL, NULL); # else cmd_cache = kmem_cache_create(THIS_MODULE->name, sizeof(struct tcb), - 0, SLAB_HWCACHE_ALIGN, NULL); + 0, cache_flags, NULL); # endif #endif -- cgit v1.2.3