dde_linux: implement kmem_cache_destroy

Note, this enables more information on wifi-driver error recovery.

Issue #5036
This commit is contained in:
Alexander Boettcher 2023-07-20 14:59:02 +02:00 committed by Christian Helmuth
parent 4d1e75ce3b
commit 65b619e7b4
6 changed files with 21 additions and 42 deletions

View File

@ -457,14 +457,6 @@ void * kmem_cache_alloc_lru(struct kmem_cache * cachep,struct list_lru * lru,gfp
}
#include <linux/slab.h>
void kmem_cache_destroy(struct kmem_cache * s)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kstrtox.h>
noinline int kstrtoint(const char * s,unsigned int base,int * res)

View File

@ -397,14 +397,6 @@ void * kmem_cache_alloc_lru(struct kmem_cache * cachep,struct list_lru * lru,gfp
}
#include <linux/slab.h>
void kmem_cache_destroy(struct kmem_cache * s)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kstrtox.h>
noinline int kstrtoint(const char * s,unsigned int base,int * res)

View File

@ -58,12 +58,31 @@ struct kmem_cache * kmem_cache_create(const char * name,
{
struct kmem_cache * cache =
__kmalloc(sizeof(struct kmem_cache), GFP_KERNEL);
cache->size = size;
cache->align = align;
cache->size = size;
cache->align = align;
cache->refcount = 1;
return cache;
}
void kmem_cache_destroy(struct kmem_cache *cache)
{
if (!cache)
return;
if (!cache->refcount) {
printk("%s unexpected case - potential memory leak\n", __func__);
return;
}
if (cache->refcount > 0)
cache->refcount --;
if (!cache->refcount)
lx_emul_mem_free(cache);
}
void kmem_cache_free(struct kmem_cache * s, void * x)
{
lx_emul_mem_free(x);

View File

@ -1562,14 +1562,6 @@ void kill_anon_super(struct super_block * sb)
}
#include <linux/slab.h>
void kmem_cache_destroy(struct kmem_cache * s)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kmsg_dump.h>
void kmsg_dump(enum kmsg_dump_reason reason)

View File

@ -271,14 +271,6 @@ void * kmem_cache_alloc_lru(struct kmem_cache * cachep,struct list_lru * lru,gfp
}
#include <linux/slab.h>
void kmem_cache_destroy(struct kmem_cache * s)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int kobject_synth_uevent(struct kobject * kobj,const char * buf,size_t count)

View File

@ -635,14 +635,6 @@ void kill_fasync(struct fasync_struct ** fp,int sig,int band)
}
#include <linux/slab.h>
void kmem_cache_destroy(struct kmem_cache * s)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kmsg_dump.h>
void kmsg_dump(enum kmsg_dump_reason reason)